[Nitro] Og's answer to migrations?

George Moschovitis george.moschovitis at gmail.com
Sat Dec 8 04:37:15 EST 2007


just write a small script:

for u in User.all
  PhoneNumber.create(u.phone, u)
end

then just call alter table drop column to remove the uneeded column.

-g.

On Dec 8, 2007 7:44 AM, Arne Brasseur <arne at arnebrasseur.net> wrote:

> I was just thinking about this, say you're building an address book app.
> At first you give every address one phone number, but people start
> complaining and so you want to add a separate table for phone numbers so
> an address can have n phone numbers. Naturally you want to keep your
> data. Does Og have any functionality whatsoever to assist here?
>
> If you're familiar with Og, how would you do this?
>
> (ab)
>
> --
> Ein Fuchs muß tun, was ein Fuchs tun muß
> arne at arnebrasseur.net
>
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general




-- 
http://me.gr
http://joy.gr
http://cull.gr
http://nitroproject.org
http://phidz.com
http://joyerz.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071208/2cc351a1/attachment.html 


More information about the Nitro-general mailing list