Skip to content

Commit

Permalink
Remove FK that blocks bin/doctrine.php schema updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Aug 17, 2016
1 parent 222be40 commit 5f4aa3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Migrations/Schema/V110/Version20151101082200.php
Expand Up @@ -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");
}
}

/**
Expand Down

0 comments on commit 5f4aa3e

Please sign in to comment.