migration

Ajit
Fri, 03 Oct 2008 15:46:09 -0000

hello All

I am trying to create a table using rails migrations. after creating
the table i want to move data from one table to newly created table.
everything seems to be working fine.. only issue is speed of moving
data.

Abc.find(:all).each do |a|

      xyz.new do |x|
              xyz.id = a.id
             xyz.save
      end
end

i have over 200,000 rows in my table.. and it is very slow...

is there a better way to move data quickly?

Please advice..

Cheers

Ajit


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---