I usually create a folder in db called data_import and put my data
import files and scripts there. You can use script/runner to execute
your load programs within the Rails environment.
ruby script/runner 'load "db/data_import/my_script.rb"'
Another way to run your data load program is with a custom rake
task. In lib/tasks create a file with a .rake extension and then
create a task:
desc 'Load my data.'
task :load_my_data => :environment do
Then run it:
The money line here is "task :load_standards => :environment do".
The => :environment says that this task requires the Rails
environment to be loaded before its run.
With either of these methods you can run your data load multiple
times without mucking up your migrations.