2
我在Users表中有數據。 一列名爲:數據類型爲float的provider_user_id。如何在Rails中編寫遷移以將表列從float更改爲bigint
我想將其更改爲數據類型bigint。
我應該怎麼寫在軌道3
原始列與下面的遷移創造了這個遷移:
class AddFbuidToUsers < ActiveRecord::Migration
def self.up
add_column :users, :provider_user_id, :float
end
def self.down
remove_column :users, :provider_user_id
end
end
可能的重複:http://stackoverflow.com/questions/2799774/rails-migration-for-change-column – 2011-12-14 11:10:28