Created
December 16, 2011 16:54
-
-
Save hackjoy/1486858 to your computer and use it in GitHub Desktop.
Ruby [Migration]: Change Field/Column Data Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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