php artisan make:migration create_batles_table Created Migration: 2017_04_01_123218_create_batles_table php artisan make:migration create_batles_table [InvalidArgumentException] A CreateBatlesTable migration already exists. ---------------------File deleted by me----------------------------- php artisan make:migration create_batles_table [ErrorException] include(/home/lubuntu/Desktop/work/git/lara/database/migrations/2017_04_01_123218_create_batles_table.php): fail ed to open stream: No such file or directory
现在使用另一个名字" newbatles"而不是" batles"
php artisan make:migration create_newbatles_table Created Migration: 2017_04_01_123343_create_newbatles_table php artisan make:migration create_newbatles_table [InvalidArgumentException] A CreateNewbatlesTable migration already exists. -----------File deleted by me-------------- php artisan make:migration create_newbatles_table [ErrorException] include(/home/lubuntu/Desktop/work/git/lara/database/migrations/2017_04_01_123343_create_newbatles_table.php): f ailed to open stream: No such file or directory
为什么我无法在Laravel 5.4中重新创建具有相同名称的迁移?
答案 0 :(得分:1)
在迁移中更改内容时,请始终运行以下命令:
php artisan cache:clear
php artisan view:clear
php artisan route:clear
composer dump-autoload
它将清除所有旧东西并顺利运行!
<强>更新强>
但请记住:表名在该数据库中必须是唯一的...它就像硬盘上文件夹的名称。您不能拥有多个具有该特定名称的表格!
答案 1 :(得分:-1)
您是否也从迁移表中删除了它?
如果没有,请运行
php artisan migrate:refresh
刷新表格。 但请注意,这样您将清理所有数据库表! 因此,如果您不想这样做,只需直接从数据库中删除迁移。