1

I'm trying to add an icon_path column to an existing table called tbl_device
by using php artisan make:migration add_icon_path_to_tbl_device_table --table=tbl_device

and after running php artisan migrate, it gives me this error.

PHP Fatal error:  Cannot declare class CreateFailedJobsTable, because the name is already in use in ...path\database\migrations\<date>_create_failed_jobs_table.php    
Cannot declare class CreateFailedJobsTable, because the name is already in use

I've also tried manually adding the icon_path column to the create_tbl_device_table.php migration and after running php artisan migrate it says Nothing to migrate.

I think I followed all the instructions.. any idea where I went wrong?

stackved12
  • 111
  • 1
  • 7
  • Did you ran `php artisan queue:table` twice? You have two migrations called `create_failed jobs_table`or `create_jobs_table` or `create_session_table` in your migration folder? If so, then delete the duplicate from your migration directory and try again. r. Run `composer dump-autoload` afterwards to be on a save side. – STA Oct 13 '20 at 16:25
  • The error shows that you have 2 migrations files trying to create a failed_jobs table. Please check your migrations folder and make sure there are no duplicated files. This error not related to adding a column migration file. – Henry Bui Oct 13 '20 at 16:32

1 Answers1

0

Call artisan migrate command only for your specific migration using:

php artisan migrate --path=/database/migrations/my_migrations

And see if it works.

ineptant
  • 59
  • 1
  • 9