diff --git a/database/migrations/2021_11_19_142529_create_user_infos_table.php b/database/migrations/2021_11_19_142529_create_user_infos_table.php index 4a47630b..6ec275dc 100644 --- a/database/migrations/2021_11_19_142529_create_user_infos_table.php +++ b/database/migrations/2021_11_19_142529_create_user_infos_table.php @@ -16,7 +16,7 @@ class CreateUserInfosTable extends Migration Schema::create('user_infos', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('user_id')->unique()->comment('用户ID'); - $table->unsignedBigInteger('inviter_id')->nullable()->comment('邀请人ID'); + $table->unsignedBigInteger('inviter_id')->index()->nullable()->comment('邀请人ID'); $table->string('nickname', 100)->nullable()->comment('昵称'); $table->string('avatar')->nullable()->comment('头像'); $table->enum('gender', ['male', 'female', 'unknown'])->default('unknown')->comment('性别:male 男性,female 女性,unknown 未知');