Skip to content

Instantly share code, notes, and snippets.

@drymar
Forked from matfiz/migration.rb
Created April 11, 2017 08:59
Show Gist options
  • Save drymar/82202aa308d502aa0e46d902cea81122 to your computer and use it in GitHub Desktop.
Save drymar/82202aa308d502aa0e46d902cea81122 to your computer and use it in GitHub Desktop.
Reversible change_column Rails migration
reversible do |dir|
dir.up { change_column :posts, :name, :text }
dir.down { change_column :posts, :name, :string }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment