[5.0-rc2] Don't remove skip foreign key when join entity type is configured explicitly. #22652
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.
Fixes #22521
Description
Usually the shared-type join entity type is created by convention, but when the configuration source is upgraded to
Explicit
the declared foreign keys that are created by convention are misidentified as unnecessary and removed.Customer Impact
The issue only affects a new 5.0 feature - many-to-many when the join entity type created by convention is configured explicitly without configuring the associated foreign keys. The workaround is to configure the relationship fully, which requires 3-5 more lines of code.
How found
Customer reported on RC1.
Test coverage
This PR adds a test for the affected scenario.
Regression?
No, new feature in 5.0.
Risk
Low. The fix only affects a new 5.0 feature and the issue is fixed by not removing a part of the configuration, which is generally safe.