///迁移此文件时出现上面的错误
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class SubjectOrderForExam extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('subjectOrderingForExam', function(Blueprint $table)
{
$table->integer('id', true);
$table->integer('subjectId');
$table->integer('classId');
$table->integer('sectionId');
$table->string('subjectName', 255);
$table->integer('orderingNo');
$table->enum('isDelete', ['0','1'])->default('0');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('subjectOrderingForExam');
}
}
也许您没有为此使用所有必需的名称空间。
作为示例,在我的laravel 6项目之一中,我在开始时包括以下内容(请注意Schema ns):
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;