I have a rails project running that defines the standard production:, :development and :test DB-connections in config/database.yml
In addition I have a quiz_developm
You could use this version, which also supports rake db:rollback:
class ChangeQuiz < ActiveRecord::Migration
def connection
ActiveRecord::Base.establish_connection("quiz_#{Rails.env}").connection
end
def reset_connection
ActiveRecord::Base.establish_connection(Rails.env)
end
def up
# make changes
reset_connection
end
def self.down
# reverse changes
reset_connection
end
end