Managing migrations for separate databases

All,

I am working on an app. that deals with one legacy database about 95% of
the time, and another smaller database only rarely.

However, I find myself needing to add tables to this smaller database,
and would like to use migrations.

I understand that I can pass a RAILS_ENV to the rake db:migrate task
which will handle doing the work in the correct database.

But I’m wondering how to manage the migration files themselves. Can I
create a subdir of RAILS_ROOT/db and have that used for the migrations
for this other database? Or do I have to override/modify the db:migrate
task to allow it to look in other places for the migration files?

Thanks,
Wes

A somewhat lame fix although it works:

I added a custom task into a .rake file under lib/tasks, called
migrate_archive which is basically a copy of the db:migrate task found
under the standard Rails installation tasks.

This custom task looks in a subdirectory of db/migrate
(db/migrate/archive) for an alternative set of migrations.

Obviously, to get these to take effect in another DB requires a rake
command like

“rake db:migrate_archive RAILS_ENV=”

A better solution which I may implement later would be to make the
alternative location completely dynamic to allow for N sets of different
migrations for different DBs.

Wes