From 15f00a90f0983c0984846045c4aa010db1620470 Mon Sep 17 00:00:00 2001 From: Didier Date: Tue, 16 Jul 2024 06:55:14 +0200 Subject: [PATCH] fix migration --- ...2024_06_27_123923_add_control_measure_table.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/database/migrations/2024_06_27_123923_add_control_measure_table.php b/database/migrations/2024_06_27_123923_add_control_measure_table.php index 5372e8ec..a96b8437 100644 --- a/database/migrations/2024_06_27_123923_add_control_measure_table.php +++ b/database/migrations/2024_06_27_123923_add_control_measure_table.php @@ -12,13 +12,6 @@ */ public function up(): void { - Schema::table('controls', function (Blueprint $table) { - $table->dropForeign('controls_domain_id_foreign'); - $table->dropForeign('controls_measure_id_foreign'); - $table->dropColumn('domain_id'); - $table->dropColumn('measure_id'); - }); - Schema::create('control_measure', function (Blueprint $table) { $table->integer('control_id')->unsigned(); $table->foreign('control_id')->references('id')->on('controls'); @@ -31,6 +24,13 @@ public function up(): void if (($control->measure_id !== null)&&($control->measure_id !== 0)) $control->measures()->sync([$control->measure_id]); } + + Schema::table('controls', function (Blueprint $table) { + $table->dropForeign('controls_domain_id_foreign'); + $table->dropForeign('controls_measure_id_foreign'); + $table->dropColumn('domain_id'); + $table->dropColumn('measure_id'); + }); } /**