Php artisan migrate - 语法错误,意外''(T字符串)

迁移文件代码的代码。语法错误。


Schema::create('subjects', function (Blueprint $table) {$table->bigIncrements('id');

     $table->bigIncrements('id');

     $table->string('title')->nullable();

     $table->integer('order_id')->default('0');

     $table->unsignedBigInteger('test_type_id');

     $table->foreign('test_type_id')->references('id')->on('test_types');

     $table->enum('status',['active','deactive','draft'])->default('draft');

     $table->timestamps();

});

已经运行作曲家更新。让我知道我错过了什么。


如果问题是重复的,我很乐意将其删除。


DIEA
浏览 53回答 1
1回答

喵喵时光机

将此添加到迁移文件中,然后重试只需删除“bigIncrements”一次。 Schema::create('subjects', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title')->nullable(); $table->integer('order_id')->default(0); $table->unsignedBigInteger('test_type_id'); $table->foreign('test_type_id')->references('id')->on('test_types'); $table->enum('status',['active','deactive','draft'])->default('draft'); $table->timestamps();});
打开App,查看更多内容
随时随地看视频慕课网APP