Fix duplicate foreign key deprecation with Single Table Inheritance#12391
Open
janedbal wants to merge 2 commits into
Open
Fix duplicate foreign key deprecation with Single Table Inheritance#12391janedbal wants to merge 2 commits into
janedbal wants to merge 2 commits into
Conversation
Contributor
Author
|
Any chance somebody looks into this one? |
Member
|
It seems there are CI jobs failing. Please take a look at this guide for more on how to handle those. |
When multiple STI child entities have a ManyToOne relation to the same
target entity using the same join column, SchemaTool called
addForeignKeyConstraint twice with the same constraint name, triggering
a DBAL deprecation ("Overwriting an existing foreign key constraint").
The fix skips the redundant addForeignKeyConstraint call when an
identical FK (same local columns, same foreign table, same foreign
columns) was already added.
See doctrine/dbal#7125
f750132 to
9a912d2
Compare
Contributor
Author
|
@greg0ire None of those were related to our changes. I just rebased to trigger new pipeline. |
Member
|
That's cool. Bear in mind that I will always prioritize reviewing PRs with a green build. |
greg0ire
reviewed
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When multiple STI child entities have a
ManyToOnerelation to the same target entity using the same join column,SchemaToolcalledaddForeignKeyConstrainttwice with the same constraint name, triggering a DBAL deprecation ("Overwriting an existing foreign key constraint").The fix skips the redundant
addForeignKeyConstraintcall when an identical FK (same local columns, same foreign table, same foreign columns) was already added.See doctrine/dbal#7125