Larabbs 迁移出现 SQLSTATE [23000]: Integrity constraint violation: 1048 Column 'topic_id' cannot be null 解决?
- 如上图 如果出现 SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'topic_id' cannot be null
- 应该是 larabbs\database\seeds\DatabaseSeeder.php 中 Seeder 的顺序不对
- 导致 先填充了 user表 再填充reply表 最后填充 topic表 所以导致 填充 reply表时 缺少 topic_id
推荐文章: