Laravel使用迁移错误创建表

问题描述

我想使用迁移来创建 Brand Price Code 0 Honda Civic 22000 NaN 1 Toyota Corolla 25000 NaN 2 Ford Focus 27000 NaN 3 Audi A4 35000 NaN 表。

我的命令是tbl_teacher_students
我也尝试添加PHP artisan make:migration create_tbl_teacher_students_table,但都给了我这个错误

--create=tbl_teacher_students

我找不到与迁移有关的PHP Fatal error: Cannot declare class CreateFailedJobsTable,because the name is already in use Symfony\Component\ErrorHandler\Error\FatalError Cannot declare class CreateFailedJobsTable,because the name is already in use 错误的任何信息。
另外,我还尝试将列添加到现有表中,但这给了我同样的错误

解决方法

之所以发生这种情况,是因为在您的 database / migrataions / 目录create_failed_jobs_table.....上创建了两次。删除一个。然后运行composer dump-autoload,然后重试。这样可以解决问题