任何人都可以告訴我如何編輯以下遷移以將:phone
整數更改爲字符串?遷移:將整列更改爲字符串
class CreateContactInfos < ActiveRecord::Migration
def change
create_table :contact_infos do |t|
t.integer :phone
t.string :facebook
t.references :user
t.timestamps
end
add_index :contact_infos, :user_id
end
end
在此先感謝!
再次感謝:D – imjp
除非您打算存儲真正長的電話號碼,否則應該是':string',而不是':text',它是指超過255個字符的文本。 – tmandry