diff --git a/database/migrations/2024_07_13_100247_create_sons_table.php b/database/migrations/2024_07_13_100247_create_sons_table.php index a7e5925..0595a18 100644 --- a/database/migrations/2024_07_13_100247_create_sons_table.php +++ b/database/migrations/2024_07_13_100247_create_sons_table.php @@ -13,11 +13,14 @@ public function up(): void Schema::create('sons', function (Blueprint $table) { $table->bigIncrements('id'); - if((float) App::version() >= Constants::VERSION_AFTER_FOREIGN_ID_SUPPORT){ - $table->foreignId('father_id'); - }else { - $table->unsignedBigInteger('father_id'); - } + $table->unsignedBigInteger('father_id'); + $table->foreign('father_id')->references('id')->on('fathers'); + // + //if((float) App::version() >= Constants::VERSION_AFTER_FOREIGN_ID_SUPPORT){ + // $table->foreignId('father_id'); + //}else { + // $table->unsignedBigInteger('father_id'); + //} }); }