प्रारूप :
change_column(table_name, column_name, type, options): Changes the column to a different type using the same parameters as add_column.
आप में सबसे पहले टर्मिनल:
rails g migration change_numeric_field_in_my_table
फिर अपनी माइग्रेशन फ़ाइल में:
class ChangeNumbericFieldInMyTable < ActiveRecord::Migration
def self.up
change_column :my_table, :revenue_per_transaction, :decimal, :precision => give whatever, :scale => give whatever
end
end
तब
run rake db:migrate
स्रोत:http://api.rubyonrails.org/classes/ActiveRecord/Migration.html