I'm wondering if anyone else has faces the task of migrating multiple databases? How can one do this is an automated fashion?
Currently I'm running usual "rake db:migrate" from cmd, where I'll manually edit the database.yml :database line to indicate the current DB. This is done is a sequential fashion. While this is fine for working out the migrations, it's going to be real tedious for migrating the 50+ production databases.
Thus I'd like to come up with a ruby script that will run the migration for each DB automatically.
Two issues I see...
1. how does one run migrations from ruby? is it a `/path_to_app/rake db:migrate`, generally I like to avoid cmd line executions in scripts
2. how does one programmatically reset the migration connection? I know I can do a "model_obj.establish_connection" for ActiveRecord, but I don't see anything similar for migration.
Having these resolved, I envision something like...