Skip to content

Instantly share code, notes, and snippets.

@johnmcaliley
Created April 11, 2011 15:26
Show Gist options
  • Save johnmcaliley/913695 to your computer and use it in GitHub Desktop.
Save johnmcaliley/913695 to your computer and use it in GitHub Desktop.
Change the data type for a table column in Rails migration
class ChangeDataTypeForWidgetCount < ActiveRecord::Migration
def self.up
change_table :widgets do |t|
t.change :count, :float
end
end
def self.down
change_table :widgets do |t|
t.change :count, :integer
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment