You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I get a MySQL error (colliding index names) when trying to redefine a foreign key:
Following generated SQL fails:
ALTER TABLE `gallery_image`
DROP FOREIGN KEY `gallery_image_FK_3`
ADD CONSTRAINT `gallery_image_FK_3` FOREIGN KEY `gallery_image_FK_3` (`COLUMN_NAME`)
REFERENCES [more stuff here];
... with error message ...
ERROR 1005 (HY000) at line 26: Can't create table 'DATABASENAME.#sql-45c_e7' (errno: 121)
That error goes away if I split the statement in two ...
ALTER TABLE `gallery_image`
DROP FOREIGN KEY `gallery_image_FK_3`;
ALTER TABLE `gallery_image`
ADD CONSTRAINT `gallery_image_FK_3` FOREIGN KEY `gallery_image_FK_3` (`COLUMN_NAME`)
REFERENCES [more stuff here];
... so It seems that if both alterations are in a single statement - even though it first drops the key and then recreates it - the name still collides.
The text was updated successfully, but these errors were encountered:
Hi, I get a MySQL error (colliding index names) when trying to redefine a foreign key:
Following generated SQL fails:
... with error message ...
That error goes away if I split the statement in two ...
... so It seems that if both alterations are in a single statement - even though it first drops the key and then recreates it - the name still collides.
The text was updated successfully, but these errors were encountered: