timestamp (単数形) ではなくて timestamps (複数形) で書くこと。
単数形で書いても、特にエラーも出ないので注意。
db/create_example.rb
class CreateExample < ActiveRecord::Migration
def change
create_table :example do |t|
t.string :requester
- t.timestamp
+ t.timestamps
end
end
end
「created_at と updated_at の二個を作るので複数形」だと覚えれば良い。
環境
- Rails 4.0.13
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
メンター受付