Skip to content

Instantly share code, notes, and snippets.

@jhjguxin
Forked from wesgarrison/AddFieldToUser.rb
Created July 30, 2012 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhjguxin/3205805 to your computer and use it in GitHub Desktop.
Save jhjguxin/3205805 to your computer and use it in GitHub Desktop.
Using Rails Migration on different database than standard “production” or “development”
class AddFieldToUser < ActiveRecord::Migration
ActiveRecord::Base.establish_connection "user_#{Rails.env}"
def self.up
add_column :users, :field, :type
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment