DDC-396: SchemaDiff not working well when using ON UPDATE RESTRICT #490

Closed
opened 2026-01-22 12:40:19 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 9, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @guilhermeblanco:

SchemaDiff is considering the constraint to be always applied when calling the orm:schema-tool --update, even though it was already applied.

Example of output I get on orm:schema-tool --update --dump-sql:

ALTER TABLE user*ratings DROP FOREIGN KEY user_ratings_ibfk*2;
ALTER TABLE user*ratings DROP FOREIGN KEY user_ratings_ibfk*1;
ALTER TABLE user*ratings ADD FOREIGN KEY (to_user*id) REFERENCES users(id) ON UPDATE RESTRICT ON DELETE CASCADE;
ALTER TABLE user*ratings ADD FOREIGN KEY (user*id) REFERENCES users(id) ON UPDATE RESTRICT ON DELETE CASCADE; 
Originally created by @doctrinebot on GitHub (Mar 9, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @guilhermeblanco: SchemaDiff is considering the constraint to be always applied when calling the orm:schema-tool --update, even though it was already applied. Example of output I get on orm:schema-tool --update --dump-sql: ``` ALTER TABLE user*ratings DROP FOREIGN KEY user_ratings_ibfk*2; ALTER TABLE user*ratings DROP FOREIGN KEY user_ratings_ibfk*1; ALTER TABLE user*ratings ADD FOREIGN KEY (to_user*id) REFERENCES users(id) ON UPDATE RESTRICT ON DELETE CASCADE; ALTER TABLE user*ratings ADD FOREIGN KEY (user*id) REFERENCES users(id) ON UPDATE RESTRICT ON DELETE CASCADE; ```
admin added the Bug label 2026-01-22 12:40:19 +01:00
admin closed this issue 2026-01-22 12:40:20 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 10, 2010):

Comment created by @beberlei:

Are you on Mysql 5.0?

@doctrinebot commented on GitHub (Mar 10, 2010): Comment created by @beberlei: Are you on Mysql 5.0?
Author
Owner

@doctrinebot commented on GitHub (Mar 10, 2010):

Comment created by @guilhermeblanco:

mysql Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486) using EditLine wrapper

@doctrinebot commented on GitHub (Mar 10, 2010): Comment created by @guilhermeblanco: mysql Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486) using EditLine wrapper
Author
Owner

@doctrinebot commented on GitHub (Mar 11, 2010):

Comment created by @beberlei:

Fixed in 2ebd2c901e.

@doctrinebot commented on GitHub (Mar 11, 2010): Comment created by @beberlei: Fixed in https://github.com/doctrine/dbal/commit/2ebd2c901ec00e91b50b452467cc7097f66b8e8c.
Author
Owner

@doctrinebot commented on GitHub (Mar 11, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Mar 11, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#490