From 1ccaa19d9c7be2589e9d1916b742ec8944953ddf Mon Sep 17 00:00:00 2001 From: Lupu Gheorghe Date: Tue, 5 Sep 2023 18:24:54 +0300 Subject: [PATCH] add on cascade on delete for donation --- .../migrations/2023_06_23_114929_create_donations_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2023_06_23_114929_create_donations_table.php b/database/migrations/2023_06_23_114929_create_donations_table.php index 7e1a97d9..9b012751 100644 --- a/database/migrations/2023_06_23_114929_create_donations_table.php +++ b/database/migrations/2023_06_23_114929_create_donations_table.php @@ -15,7 +15,7 @@ public function up(): void { Schema::create('donations', function (Blueprint $table) { $table->id(); - $table->foreignIdFor(\App\Models\User::class)->nullable()->constrained(); + $table->foreignIdFor(\App\Models\User::class)->nullable()->constrained()->cascadeOnDelete(); $table->foreignIdFor(\App\Models\Organization::class)->constrained()->cascadeOnDelete(); $table->foreignIdFor(\App\Models\Project::class)->constrained()->cascadeOnDelete(); $table->foreignIdFor(\App\Models\ChampionshipStage::class)->nullable()->constrained()->cascadeOnDelete();