[DBAL-58] Schema tool does not see difference between onDelete="NO ACTION" and onDelete="RESTRICT" Created: 11/Aug/10 Updated: 31/Oct/10 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Schema Managers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Jan Obrátil | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
If database has ON DELETE CASCADE, schema tool detects change to NO ACTION and RESCRICT. Detecting of changes is done by: |
| Comments |
| Comment by Benjamin Eberlei [ 11/Aug/10 ] |
|
which database version do yo uuse? can you paste an example schema? |
| Comment by Jan Obrátil [ 11/Aug/10 ] |
|
This is example script with 2 testing entities. |
| Comment by Jan Obrátil [ 11/Aug/10 ] |
|
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 by Benjamin Eberlei [ 31/Oct/10 ] |
|
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 |