Reputation: 1181
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
Now using another name "newbatles" instead of "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
Why I can't recreate migrations with same name in Laravel 5.4?
Upvotes: 1
Views: 2011
Reputation: 15037
When changing something in migrations always run these commands:
php artisan cache:clear
php artisan view:clear
php artisan route:clear
composer dump-autoload
It will clear all old stuff and run smoothly!
Update:
But remember: the table name must be unique inside that database...it's like a name for folder on a hard drive. You can't have more than one table with that specific name!
Upvotes: 2