【发布时间】:2021-06-01 10:14:46
【问题描述】:
我正在尝试将 follower_id 连接到用户 ID,而我得到的只是这个错误。任何人都可以帮忙。这是我的代码:
Schema::create('followers', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger("user_id");
$table->foreignId("user_id")->constrainted()->onDelete();
$table->unsignedBigInteger("follower_id");
$table->foreignId("follower_id")->constrainted()->onDelete();
$table->timestamps();
});
}
$table->id();
$table->string("username");
$table->string("email");
$table->string("password");
$table->timestamps();
});
}
【问题讨论】:
标签: php mysql laravel migration laravel-8