删除的迁移文件正在执行:Laravel 应用程序

Sha*_*lom 1 database-migration laravel laravel-5.4 laravel-artisan

我删除了一些迁移文件。但是当我执行 php artisan migrate 命令时,旧迁移文件中显示错误。

[Illuminate\Database\QueryException]
SQLSTATE[HY000]:一般错误:1215 无法添加外键约束(SQL :在删除级联上更改表cushbu_notifications添加约束 cushbu_notifications_art_id_foreign外键 ( art_id) 引用cushbu_arts( ))id

现在我没有 cushbu_notifications 的迁移文件,而是为 cushbu_user_notifications 创建了一个新的迁移文件。我从数据库中删除了 cushbu_notifications 表,也从迁移表中删除了相应的条目。

Gau*_*Rai 5

手动删除迁移文件后,通过以下命令清除缓存,然后迁移

php artisan cache:clear
Run Code Online (Sandbox Code Playgroud)

然后

php artisan migrate
Run Code Online (Sandbox Code Playgroud)