On 13 August 2010 21:05, Fearless Fool <li...@ruby-forum.com> wrote: > [...] > Colin Law (Guest) wrote: >> I suppose you could test RAILS_ENV in the migration rb file >> and only do the migration if it is appropriate for the env >> specified. Then rake db:migrate RAILS_ENV=development >> would apply relevant migrations to the development db >> rake db:migrate RAILS_ENV=external would apply relevant >> migrations to the external db. > > Heh -- that could be pretty cool -- I'd have to think a bit deeper on > this approach, as we wouldn't want migrate's state to get confused > (since it is written in the database itself).
A good point, but I think it would be ok. If you test the env inside the migration class, so that for the 'wrong' db it just appears like a do-nothing migration, then I think the fact that the migration has been run should be recorded as normal and all should be well. If that makes sense. Colin -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.