Jira issue originally created by user cmodijk:
I'm using doctrine migrations to change a null field to a not null field. MySQL 5.6 is strict on altering tables with foreign key constraint's.
ALTER TABLE badges CHANGE fkProjectId fkProjectId INT NOT NULL
Result in the following error
Cannot change column 'fkProjectId': used in a foreign key constraint 'FK_1483A5E9F28AE4EA'
As of 5.6.7, the server prohibits changes to foreign key columns with the potential to cause loss of referential integrity. A workaround is to use ALTER TABLE ... DROP FOREIGN KEY before changing the column definition and ALTER TABLE ... ADD FOREIGN KEY afterward.
Comment created by @ocramius:
[~cmodijk] what versions of DBAL/ORM are affected by the bug?
Comment created by cmodijk:
Doctrine 2.3.4 / 2a37b00.
Comment created by @deeky666:
[~ocramius] I wonder whether we should introduce MySqlPlatform567 to fix this which adds this behaviour. We could also fix this is MySqlPlatform directly but I don't know if this impacts performance for older versions of MySQL that don't require this behaviour.
Comment created by tmartin:
I encounter the same issue with doctrine/dbal 2.4.2 (commit fec965d).
Have you any idea of when this bug will be fixed? Or may be can you guide me on how to fix it and I could make a PR on doctrine/dbal.
[cmodijk] , [tmartin] I will work on this issue as soon as I have time. Expect a fix for this in the upcoming weeks. Thank you for your patience.
The same error occurs with MariaDB version 10.0.7
I already started work on this but didn't have time to finish it, yet. I will try to find some time for this this evening.
Comment created by xplorer:
I have the same issue
Comment created by maxmukhin:
The same issue in the project.