我正在尝试迁移(更新)这个,但我不断收到此错误消息:
[Symfony \ Component \ Debug \ Exception \ FatalErrorException]语法错误, 意外的'>',期待'<'
Schema::table('products', function (Blueprint $table)) {
$table->string('XXXX', 50)->change();
$table->string('XXXX', 50)->change();
$table->string('XXXX', 10)->change();
$table->String('XXXX', 100)->change();;
$table->String('XXXX', 100)->change();
$table->String('XXXX', 100)->change();
$table->String('XXXX', 50)->change();
$table->tinyInteger('XXXX')->unsigned()->change();
$table->tinyInteger('XXXX')->unsigned()->change();
$table->String('XXXX', 100)->change();
$table->tinyInteger('XXXX')->unsigned()->change();
$table->String('XXXX', 50)->change();
$table->String('XXXX', 50)->change();
$table->String('XXXX', 50)->change();
$table->String('XXXX', 50)->change();
$table->String('XXXX', 50)->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->boolean('XXXX')->change();
$table->text('XXXX')->change();
$table->String('XXXX', 100)->change();
$table->String('XXXX', 100)->change();
$table->String('XXXX', 100)->change();
$table->String('XXXX', 100)->change();
$table->tinyInteger('XXXX')->unsigned()->change();
$table->tinyInteger('XXXX')->unsigned()->change();
$table->tinyInteger('XXXX')->unsigned()->change();
$table->tinyInteger('XXXX')->unsigned()->change();
$table->String('XXXX', 50)->change();
$table->String('XXXX', 50)->change();
$table->String('XXXX', 50)->change();
$table->String('XXXX', 50)->change();
$table->text('XXXX');
$table->timestamps();
});
}
答案 0 :(得分:1)
您在第5行有;;
,String
代替string
。
顺便说一句,当你运行migrate
命令时,你可以从另一个文件(控制器,中间件,帮助器等)中获得错误。
答案 1 :(得分:0)
在Laravel Migration Documentation中,它说使用$table->string('XXXX',50);
创建VARCHAR
等效列。
因此语句$table->String('XXXX', 50)->change();
存在语法错误。您应该将所有String
更改为string
。
PS :实际上在$table->String('XXXX', 100)->change();;
语句中。您使用了;;
,但没关系,没有错误会被报告。