: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