这里是我的模型迁移轨道模型默认值
class CreateSwimmingClassschedules < ActiveRecord::Migration
def change
create_table :swimming_classschedules do |t|
t.integer :slot_id
t.integer :coach_id
t.integer :level_id , :default => 1
t.string :note
t.timestamps
end
end
end
我希望以后我打电话
Swimming::Classchedule.create(:coach_id=>8)
它会生成表默认level_id。但不知何故,它没有奏效。我在使用SQLite的开发环境中。
我加
:default => 1
我跑
rake db:migrate
它的问题之后? 我失踪的东西?