Importing data


#1

I have an application that needs to have some tables initially
populated,
such as users, roles, and basic configuration data. The best thing I can
think of is to just use put together a script that uses activerecord to
load
the data. Is there a better way?

Chris


#2

Hi !

2005/11/11, snacktime removed_email_address@domain.invalid:

I have an application that needs to have some tables initially populated,
such as users, roles, and basic configuration data. The best thing I can
think of is to just use put together a script that uses activerecord to load
the data. Is there a better way?

Migrations ? With migrations, you can do anything, including using
ActiveRecord instances to populate data. I often do that myself, as
well as use it to clean up records.

Hope that helps !
François


#3

On 11/11/05, Francois B. removed_email_address@domain.invalid wrote:

Migrations ? With migrations, you can do anything, including using
ActiveRecord instances to populate data. I often do that myself, as
well as use it to clean up records.

Hope that helps !
François

Yes migrations looks like a good place to add initial data and anything
else
that might need to be added for upgrades. Thanks for the pointer.

Chris