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

[6.0.1] Update the foreign key builder after IsRequired() #26719

Merged
merged 2 commits into from
Nov 17, 2021

Conversation

AndriySvyryd
Copy link
Member

@AndriySvyryd AndriySvyryd commented Nov 17, 2021

Fixes #26611

Description

When IsRequired() is called for a foreign key specified on a shadow property we replace the property to change in to a non-nullable type. This invalidates the current reference held by the builder.

Customer impact

All method calls after IsRequired() for a foreign key specified on a shadow property will throw an exception. A workaround would involve separating these calls and repeating some of the setup.

How found

Customer reported on 6.0

Regression

Yes, this worked in 5.0

Testing

Added test for this scenario.

Risk

Low, the fix is to update the foreign key reference held by the builder. Also added a quirk mode.

@AndriySvyryd AndriySvyryd added this to the 6.0.x milestone Nov 17, 2021
@AndriySvyryd AndriySvyryd requested a review from a team November 17, 2021 01:54
@ajcvickers ajcvickers modified the milestone: 6.0.x Nov 17, 2021
@AndriySvyryd AndriySvyryd modified the milestones: 6.0.x, 3.1.x, 6.0.1 Nov 17, 2021
@AndriySvyryd AndriySvyryd changed the title [6.0.x] Update the foreign key builder after IsRequired() Update the foreign key builder after IsRequired() Nov 17, 2021
@AndriySvyryd AndriySvyryd merged commit 970e8a4 into release/6.0 Nov 17, 2021
@AndriySvyryd AndriySvyryd deleted the Issue26611 branch November 17, 2021 19:10
@AndriySvyryd AndriySvyryd removed this from the 6.0.1 milestone Nov 17, 2021
@ajcvickers ajcvickers changed the title Update the foreign key builder after IsRequired() [6.0.1] Update the foreign key builder after IsRequired() Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants