📜  laravel 迁移中的长文本 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:24.849000             🧑  作者: Mango

代码示例2
Schema::table('posts', function (Blueprint $table) {
    $table->unsignedBigInteger('user_id');

    $table->foreign('user_id')->references('id')->on('users');
});
OR
Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained();
});