0
這是我的移民代碼:Rails4創建一對多關係,無需在遷移中添加引用?
create_table :ploys do |t|
t.string :name, null: false
t.references :user
t.timestamps
end
然後我運行此命令:
rake db:migrate
然後我檢查我的數據庫結構
但我沒有看到外鍵和refercences
我使用rails4和mysql