From 3a5741363137bc595733ee44e6f4105b806fb5a7 Mon Sep 17 00:00:00 2001 From: Ruslan Baidan Date: Wed, 9 Oct 2024 16:32:07 +0200 Subject: [PATCH] Updated the way of the foreign keys dropping. --- migrations/db/20230901112005_fix_positions_cleanup_db.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migrations/db/20230901112005_fix_positions_cleanup_db.php b/migrations/db/20230901112005_fix_positions_cleanup_db.php index 7d9ff34e..3c6e71b1 100644 --- a/migrations/db/20230901112005_fix_positions_cleanup_db.php +++ b/migrations/db/20230901112005_fix_positions_cleanup_db.php @@ -223,6 +223,7 @@ public function change() ->update(); /* Apply measures relation to soa. */ $soaTable = $this->table('soa'); + $this->execute('ALTER TABLE `soa` DROP FOREIGN KEY `soa_ibfk_2`'); $soaTable->dropForeignKey(['measure_id', 'anr_id'])->update(); $soaTable->renameColumn('measure_id', 'measure_uuid')->update(); $soaTable->addColumn('measure_id', 'integer', ['signed' => false, 'after' => 'id'])->update(); @@ -234,7 +235,7 @@ public function change() ->update(); /* Apply measures relation to measures_amvs. */ $measuresAmvsTable = $this->table('measures_amvs'); - $measuresAmvsTable->dropForeignKey(['measure_id', 'anr_id'])->update(); + $this->execute('ALTER TABLE `measures_amvs` DROP FOREIGN KEY `measures_amvs_ibfk_3`'); $measuresAmvsTable ->removeColumn('anr_id2') ->removeColumn('creator') @@ -261,7 +262,7 @@ public function change() $measuresAmvsTable->removeColumn('measure_uuid')->update(); /* Apply measures relation to measures_rolf_risks. */ $measuresRolfRisksTable = $this->table('measures_rolf_risks'); - $measuresRolfRisksTable->dropForeignKey(['measure_id', 'anr_id'])->update(); + $this->execute('ALTER TABLE `measures_rolf_risks` DROP FOREIGN KEY `measures_rolf_risks_ibfk_3`'); $measuresRolfRisksTable ->removeColumn('creator') ->removeColumn('created_at')