【问题标题】:Laravel create table using migration errorLaravel 使用迁移错误创建表
【发布时间】:2021-01-30 18:17:57
【问题描述】:

我想使用迁移创建一个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

我找不到任何关于 CreateFailedJobsTable 与迁移相关的错误的信息。
此外,我还尝试将列添加到现有表中,但它给了我同样的错误。

【问题讨论】:

    标签: laravel migration laravel-migrations


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-04
      • 2016-07-04
      • 2015-01-14
      • 2013-09-26
      • 2017-07-02
      • 1970-01-01
      • 2014-04-03
      • 2015-03-28
      相关资源
      最近更新 更多