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

Fix foreign key name change detection #6418

Conversation

achterin
Copy link
Contributor

@achterin achterin commented Jun 2, 2024

Q A
Type bug
Fixed issues #6390

Summary

This changes how the schema comparator treats foreign key name changes.
The index renaming had the same behavior in the past, expecting a index name change to result in an empty table diff. This was changed some time ago but foreign key changes were still not picked up by the comparator. This pr will change that.
While at it, I've also changed the names of both tests to reflect the changes.

As it was discussed in #6413 the test code should be reworked to be as exact as possible. So essentially my changes got merged to 3.8.x and 3.9.x but got left out in the 4.0.x merge (#6417). This is the initial code with more precise testing as it tests for the added/removed foreign key constraints and not only the count for each of them.

As index renaming support was introduced a while back do the same for
foreign key name changes.

Signed-off-by: Christoph Krapp <[email protected]>
Both tests did expect a name change to result in an empty table diff in
the past. When index renaming support was introduced the name of the
test was not changed to reflect the new expectation.

Signed-off-by: Christoph Krapp <[email protected]>
@achterin achterin changed the title Foreign key name change detection Fix foreign key name change detection Jun 2, 2024
@greg0ire greg0ire added the Bug label Jun 2, 2024
@greg0ire greg0ire added this to the 4.0.3 milestone Jun 2, 2024
@greg0ire greg0ire merged commit cbd0e9a into doctrine:4.0.x Jun 2, 2024
77 checks passed
@greg0ire
Copy link
Member

greg0ire commented Jun 2, 2024

Thanks @achterin !

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

Successfully merging this pull request may close these issues.

None yet

2 participants