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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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=<name of alternative environment>" 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---