[Rails] Re: Using fixtures inside migrations
Iván Vega Rivera
ivanvega at gmail.com
Fri Apr 21 20:46:59 GMT 2006
I found this: http://textsnippets.com/posts/show/320
Do you think it would be better to use rake tasks for this? Or is the
migration better?
On 4/21/06, Iván Vega Rivera <ivanvega at gmail.com> wrote:
> Hi,
>
> I want to add data from a fixture file to a table inside a migration.
> I've saved the file in db/migrate/fixtures/countries.yml
>
> I guess I could just open the file, read the entries, and add them to
> the database using AR, but I'm hoping I can use Rails for all that.
>
> Also, if I have a file, say, with 200,000+ records, what would be the
> best method (performance-wise) to go about this? I was thinking
> splitting the data on multiple files, each about 10,000 records or
> so... what do you think?
>
> I don't want to use SQL for this, to avoid problems between different databases.
>
> Thanks a lot!
>
> Ivan V.
>
More information about the Rails
mailing list