我定义了不同模型之间的关系(belongsto(),hasmany())。我是否还需要在数据库中添加外键约束?
发布于 2014-03-23 00:49:42
可以,在完成所有表迁移后,您需要在单独的迁移中添加FK。有关任何其他详细信息,请参阅文档。http://laravel.com/docs/schema#creating-and-dropping-tables
https://stackoverflow.com/questions/22580489
相似问题