Affects Version/s: 2.3.4
Fix Version/s: None
Security Level: All
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.