Skip to content

Instantly share code, notes, and snippets.

@findchris
Created April 5, 2014 00:26
Show Gist options
  • Save findchris/9985704 to your computer and use it in GitHub Desktop.
Save findchris/9985704 to your computer and use it in GitHub Desktop.
Run a single schema migration
class OneOff < ActiveRecord::Migration
def connection
ActiveRecord::Base.establish_connection("whatever_#{Rails.env}").connection
end
def up
puts 'up'
end
def down
puts 'down'
end
end
OneOff.new.migrate(:up)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment