[DBAL-359] [GH-211] Fix dropping foreign key multiple times with test Created: 04/Oct/12  Updated: 05/Oct/12  Resolved: 05/Oct/12

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of sdepablos:

Url: https://github.com/doctrine/dbal/pull/211

Message:

In some cases the Comparator class returns multiple drops for the same foreign key.
Specifically, in case you have two tables, A & B, with A having a foreign key FK
referencing B, if you drop table B, the resulting diff shows this FK twice,
once on the diff->orphanedForeignKeys array as we're deleting B, and another on
the diff->changedTables array as table A is also being modified. As a result of this you
get the DROP FOREIGN KEY instruction twice in the final SQL.

I'm not really sure if this change should be done in the Comparator clas or if it's better to
receive the full diff, even with duplicated drops for FK and later, when generating the final
SQL, drop the unnecessary ones



 Comments   
Comment by Benjamin Eberlei [ 04/Oct/12 ]

A related Github Pull-Request [GH-211] was closed
https://github.com/doctrine/dbal/pull/211

Generated at Mon Apr 21 07:33:29 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.