Re: Massive data insert during migration

Richard Livsey
Thu, 14 Sep 2006 02:47:39 -0000

Will Gant wrote:
> Hello all,
> I''ve got a site that will be used by people (hopefully) all over
the
> world. One of the requirements of registration is country and province
> of residence. I have a list of all the countries in the world and all
> their subnational entities. Currently, the two lists are divided
> between a pair of comma-delimited text files. If this were something
> less dynamic and cool, I''d probably import it into Excel or some
> equivalent and then do some find-and-replace voodoo to create the SQL
> statements to enter it into the database. What would you do if you
> were doing this in rails and wanted to make sure this data was
> inserted when you run a migrate task?
>
> Will
You could convert it to YAML and then import it with your migration
using the ''migration data dumper''

I wrote a post in this last month:
http://livsey.org/articles/2006/08/15/populating-the-database-with-migrations

The plugin:
http://blog.tammersaleh.com/articles/2006/08/15/migration-data-dumper-plugin

hth

--
Richard Livsey