-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabled/re-enabled foreign key checks on several migrations to get them to work with MySQL 5.6+ #1451
Conversation
I would be more comfortable dropping a re-creating keys. Disabling all keys might get us into trouble with some fringe association. Whereas if we drop and re-create keys it should be clear exactly what is happening. We should also investigate if doctrine write-locks the table when it is migrating. If not then we should if we are messing with the keys. |
$this->addSql('ALTER TABLE session_type ADD CONSTRAINT FK_4AAF5703C32A47EE FOREIGN KEY (school_id) REFERENCES school (school_id)'); | ||
$this->addSql('ALTER TABLE curriculum_inventory_sequence_block DROP FOREIGN KEY FK_22E6B6806081C3B0'); | ||
$this->addSql('ALTER TABLE curriculum_inventory_sequence_block DROP FOREIGN KEY FK_22E6B680591CC992'); | ||
//$this->addSql('ALTER TABLE curriculum_inventory_sequence_block DROP FOREIGN KEY FK_22E6B680DEB52F47'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove all commented out lines of code.
reviewed and LGTM so far. but, please add the drop/create fkey queries to the respective counterparts in the |
…on20150826201107.php
Two upgrade migrations were adjusted in this pull request Version20150826215733.php and Version20160122173943.php. When migrating up to the most recent version (Version20160122173943), and then attempting to migrate down again, the following exception is thrown: Migration 20160111222451 failed during Execution. Error This migration cannot be reversed, it would unpublish everything.
[Doctrine\DBAL\Migrations\IrreversibleMigrationException]
This migration cannot be reversed, it would unpublish everything. None of the changes made to Version20160122173943.php fail the downgrade process prior to this point, so there is no need to add new steps to the downgrade migration. When migrating up to the other version file changed in this pull request (Version20150826215733), and then attempting to migrate down again, the following error is thrown: Fatal error: Call to undefined method Ilios\Migrations\Version20150805000000::abort() in /Users/hedrick/Documents/projects/ilios/app/Resources/DoctrineMigrations/Version20150805000000.php on line 264 This undefined abort() method is called from the initial migration class Version20150805000000.php If this abort() method is properly defined/fixed in Version20150805000000.php, the Version20150826215733 downgrade migration process should complete without failing. |
…hecoolestguy replaced call to non-existent method with one of the same intent that works. refs #1451 (comment)
No description provided.