Php artisan migrate - 语法错误,意外的“”(T 字符串)
Php artisan migrate - syntax error, unexpected ' ' (T string )
迁移文件代码代码。语法错误。
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();
});
已经 运行 作曲家更新。让我知道我错过了什么。
如果问题重复,我很乐意将其删除。
将其添加到迁移文件中,然后重试
只需删除 '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();
});
迁移文件代码代码。语法错误。
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();
});
已经 运行 作曲家更新。让我知道我错过了什么。
如果问题重复,我很乐意将其删除。
将其添加到迁移文件中,然后重试 只需删除 '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();
});