Skip to content

Instantly share code, notes, and snippets.

@wesgarrison
Created September 24, 2010 05:02
Show Gist options
  • Save wesgarrison/594886 to your computer and use it in GitHub Desktop.
Save wesgarrison/594886 to your computer and use it in GitHub Desktop.
class AddFieldToUser < ActiveRecord::Migration
def self.up
ActiveRecord::Base.establish_connection "user_#{Rails.env}"
add_column :users, :field, :type
end
...
end
@nhodges
Copy link

nhodges commented Sep 9, 2015

How do you get around your main db trying to migrate every time? (i.e. this particular migration's version number will get added to this database's schema_migrations table, but not the primary one targeted in the standard rake db:migrate task)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment