-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
DBAL-58: Schema tool does not see difference between onDelete="NO ACTION" and onDelete="RESTRICT" #1790
Comments
Comment created by @beberlei: which database version do yo uuse? can you paste an example schema? |
Comment created by obrys: This is example script with 2 testing entities. |
Comment created by obrys: I have attached script with two entities. I have this database version: Check line 44. There is CASCADE. Change CASCADE to NO ACTION everything ok, so: $ doctrine orm:schema-tool:update Change NO ACTION to RESTRICT Change RESTRICT to CASCADE everything ok, so: $ doctrine orm:schema-tool:update Change CASCADE to RESTRICT everything ok, do: $ doctrine orm:schema-tool:update Change RESTRICT to NO ACTION So there is no way to update database schema from RESTRICT to NO ACTION and reverse! |
Comment created by @beberlei: Hm you are right, however for MySQL NO ACTION is the same as RESTRICT as stated by http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html |
Comment created by @deeky666: [~obrys] As there internally is no difference between NO ACTION AND RESTRICT in MySQL I am closing this now. Doctrine generates the correct statements here when necessary. |
Issue was closed with resolution "Invalid" |
Imported 1 attachments from Jira into https://gist.github.com/479549bb5a53125657cc |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Jira issue originally created by user obrys:
If database has ON DELETE CASCADE, schema tool detects change to NO ACTION and RESCRICT.
If database has ON DELETE RESCRICT, schema tool detects change only in case of CASCADE.
If database has ON DELETE NO ACTION, schema tool detect change only in case of CASCADE.
Detecting of changes is done by:
doctrine orm:schema-tool update --dump-sql
and
doctrine orm:validate-schema
The text was updated successfully, but these errors were encountered: