jrgoodner wrote:
> Hey there, I'm not super familiar with MySQL, so please forgive me if
> I say something stupid.
> 
> I have a large database table (it includes every zipcode in the U.S.,
> along with its city,state,latitude,longitude), and it seems that we
> are frequently dropping/creating/migrating our database.  It takes a
> very long time to migrate the zipcodes table (I do so from a .csv,
> creating a Zipcode object row by row).
> 
> I'd like to dump the table with MySQLdump.  Then, when migrating,
> rather than run the ruby code that creates a bunch of objects, instead
> load the resulting dump file.  [With the hopes that that will be a
> quicker process...think that's the case?]
> 
> I don't know how to load the dump file using Rails migrations, and I'd
> like to.  

No you wouldn't. :)  There are many good reasons not to put seed data in 
migrations.  What I recommend doing is using seed_fu or similar, but use 
ar_extensions or even an execute statement so you're not doing a 
separate query for each record.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to