Skip to content
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-592] Fix schema comparison with FK that contain quoted column names. #380

Closed

Conversation

Thinkscape
Copy link
Contributor

In case QuoteStrategy decides to quote column names for FK, schema comparator (and in effect - schema tool), will be stuck in an ALTER TABLE * DROP FOREIGN KEY loop, because it doesn't recognise old indexes with matching column names.

The problem lies inside Comparator, which relied on column names that might or might not be quoted (depending on platform, schema and dbal settings). The comparison must be performed on unquoted column names both ways, as it is already performed for normal indexes, table names and columns names.

Tests will come shortly.

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-617

We use Jira to track the state of pull requests and the versions they got
included in.

@stof
Copy link
Member

stof commented Sep 26, 2013

Can you add a test case covering this bug ?

@Thinkscape
Copy link
Contributor Author

@stof Yeah, I'm on it. I'll try to derive from the setup I currently have...

@deeky666
Copy link
Member

I think we should add Constraint::getUnquotedColumns() to the interface for consistency and make use of that. I added Constraint::getQuotedColumns() in 2.4 so I guess this BC break would be acceptable. Besides that there is already a Index::getUnquotedColumns() which does exactly the same.

@beberlei
Copy link
Member

Merged into master and 2.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants