使用make migration命令添加列错误

问题描述

我正在尝试将icon_path添加到名为tbl_device的现有表中
通过使用PHP artisan make:migration add_icon_path_to_tbl_device_table --table=tbl_device

运行PHP artisan migrate之后,它给了我这个错误

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

我还尝试了将icon_path列手动添加create_tbl_device_table.PHP迁移中,并在运行PHP artisan migrate后说nothing to migrate

我想我遵循了所有说明。.知道我哪里出错了吗?

解决方法

仅使用以下方式针对特定的迁移调用artisan migration命令:

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

看看是否可行。