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

Add test for schema diffing on a table with a renamed foreign key column referencing a renamed table #867

Merged

Conversation

billschaller
Copy link
Member

In situations where SQL is generated with SchemaDiff::toSaveSql, foreign keys for columns that have been renamed or removed were not being dropped if the referenced table was orphaned.

This PR adds a test to ensure that when a table should be renamed, and the FK columns referencing it should also be renamed, the FKs are properly removed and readded. This PR formerly fixed an issue where this was not successful, but it has since been fixed upstream, so this PR has just been pared back to the added test.

@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-1246

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

@deeky666
Copy link
Member

deeky666 commented Jan 9, 2016

@zeroedin-bill I'm sorry but this requires a rebase now.

…tables have their FK constraints properly removed.
@billschaller billschaller force-pushed the fix-fk-schemadiff-renamed-column branch from bd92239 to bdb2f2d Compare January 12, 2016 01:34
@billschaller
Copy link
Member Author

@deeky666 Somewhere upstream this was fixed, so I just pared down this pr to the added test and squashed commits.

@billschaller billschaller changed the title Fix fk schemadiff renamed column Add test for schemadiff on table with renamed fk column referencing renamed table Jan 12, 2016
@deeky666
Copy link
Member

@zeroedin-bill I think this has been addressed here: #861

@deeky666 deeky666 added this to the 2.6 milestone Jan 12, 2016
@deeky666 deeky666 self-assigned this Jan 12, 2016
deeky666 added a commit that referenced this pull request Jan 12, 2016
…column

Add test for schemadiff on table with renamed fk column referencing renamed table
@deeky666 deeky666 merged commit 6855849 into doctrine:master Jan 12, 2016
@deeky666
Copy link
Member

@zeroedin-bill Thanks!

@Ocramius Ocramius changed the title Add test for schemadiff on table with renamed fk column referencing renamed table Add test for schema diffing on a table with a renamed foreign key column referencing a renamed table Jul 22, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants