每当我尝试迁移时,我会在给定代码上得到FatalErrorException:
public function up()
{
Schema::create('category_details', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->tinyInteger('status')->comment('0 => inactive, 1 => active');
$table->timestamp('created_at')->nullable()->default(\DB::raw('CURRENT_TIMESTAMP'));
$table->interger('created_by');
$table->timestamp('updated_at')->nullable()->default(\DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));
$table->interger('updated_by');
});
}
答案 0 :(得分:2)
您的架构不正确:
$table->interger('created_by');
$table->timestamp('updated_at')->nullable()->default(\DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));
$table->interger('updated_by');
应该是integer
而不是interger
:
$table->integer('created_by');
$table->timestamp('updated_at')->nullable()->default(\DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));
$table->integer('updated_by'