我一直试图运行php工匠迁移,但总是给这个错误
这是我的迁移:`
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRhRacaCorAddCodEsocial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('rh_raca_cor', function(Blueprint $table){
$table->unsignedInteger('cod_esocial')->after('cod');
});
DB::statement("update rh_raca_cor set cod_esocial = case
when id = 1 then 4
when id = 2 then 1
when id = 3 then 5
when id = 4 then 3
when id = 5 then 2
else 6 end;
");
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('rh_raca_cor', function(Blueprint $table){
$table->dropColumn('cod_esocial');
});
}
}
`
当我搜索时,一直试图找到这个相同的错误,但不幸的是无法解决它。
1条答案
按热度按时间a11xaf1n1#
我所面临的问题与我安装的 composer 版本有关,它是最新的,但必须回到版本1.10.17