我需要回滚一个特定的表,因为我忘了提到外键。我也不希望我的数据从所有的表中丢失。
我的框架是Laravel5.4
谢谢大家
发布于 2017-05-21 18:08:20
迁移是按特定顺序应用和回滚的。因此,不存在重新适用任意迁移的“适当”方式。
无论如何,至少有两种选择:
- dump the tables so that you preserve the data
- rollback up to this particular migration
- fix and test the migration
- migrate
- load the data from dumps
发布于 2018-07-13 17:31:14
我是这样做的:
php artisan migrate;例如,如果您修改了名为"Settings“的迁移,则从DB和迁移表中删除此表,然后重新运行artisan命令。
发布于 2019-08-28 14:37:21
你能做到的
php artisan migrate:rollback --path=/database/migrations/your_file.php
https://stackoverflow.com/questions/44099885
复制相似问题