Fix dropping foreign key multiple times with test #211

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

sdepablos commented Oct 4, 2012

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

@sdepablos sdepablos Fix dropping foreign key multiple times with test
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 show this FK twice,
once on the diff->orphanedForeignKeys as we're deleting B, and another on
diff->changedTables as table A is being modified. As a result of this you get the
DROP FOREIGN KEY instruction twice in the final SQL.
1642307

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DBAL-359

Oh btw, I just (automatically) realized that you are not creating this pull request against the master branch.

Unless there are good reasons for this, i would suggest to close and rebase the Pull Request against master and then create it again. Sorry!

Owner

guilhermeblanco commented Oct 4, 2012

Wrong branch

Owner

beberlei commented Oct 5, 2012

@sdepablos can you rebase and open again against master?

Contributor

sdepablos commented Oct 5, 2012

Already done at #212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment