Skip to content

Instantly share code, notes, and snippets.

@hackjoy
Created December 16, 2011 16:54
Show Gist options
  • Save hackjoy/1486858 to your computer and use it in GitHub Desktop.
Save hackjoy/1486858 to your computer and use it in GitHub Desktop.
Ruby [Migration]: Change Field/Column Data Type
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