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 b6dbf330..4a354df1 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 @@ -25,10 +25,11 @@ public function up(): void $control->measures()->sync([$control->measure_id]); } - Schema::table('controls', function (Blueprint $table) { - $table->dropForeign(['controls_domain_id_foreign']); - $table->dropForeign(['controls_measure_id_foreign']); - }); + if (DB::getDriverName() !== 'pgsql') + Schema::table('controls', function (Blueprint $table) { + $table->dropForeign(['controls_domain_id_foreign']); + $table->dropForeign(['controls_measure_id_foreign']); + }); if (DB::getDriverName() === 'sqlite') // Could not drop column with sqlite