From 5f4aa3e78202f57ec88ce1c9bfabcecc7787b8d8 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 17 Aug 2016 13:52:24 +0200 Subject: [PATCH] Remove FK that blocks bin/doctrine.php schema updates --- app/Migrations/Schema/V110/Version20151101082200.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Migrations/Schema/V110/Version20151101082200.php b/app/Migrations/Schema/V110/Version20151101082200.php index a140f6a97be..328fed355cc 100644 --- a/app/Migrations/Schema/V110/Version20151101082200.php +++ b/app/Migrations/Schema/V110/Version20151101082200.php @@ -30,6 +30,16 @@ public function up(Schema $schema) $this->addSql("ALTER TABLE session MODIFY session_category_id INT NULL"); $this->addSql("UPDATE session SET session_category_id = NULL WHERE session_category_id NOT IN (SELECT id FROM session_category)"); + + $table = $schema->getTable('session_rel_course_rel_user'); + if ($table->hasForeignKey('FK_720167E91D79BD3')) { + $this->addSql("ALTER TABLE session_rel_course_rel_user DROP FOREIGN KEY FK_720167E91D79BD3"); + } + + $table = $schema->getTable('session_rel_course'); + if ($table->hasForeignKey('FK_12D110D391D79BD3')) { + $this->addSql("ALTER TABLE session_rel_course DROP FOREIGN KEY FK_12D110D391D79BD3"); + } } /**