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

Only null non-overlapping FK properties on delete/fixup, if possible #24538

Merged
merged 3 commits into from
Apr 3, 2021

Conversation

ajcvickers
Copy link
Contributor

Fixes #23883

This is only relevant for overlapping composite foreign keys, where nulling all FK values can also sever other relationships. Since a composite FK is null if any part is null, we avoid nulling the properties that are also shared with another foreign key.

@ajcvickers ajcvickers requested a review from a team March 29, 2021 14:37
Fixes #23883

This is only relevant for overlapping composite foreign keys, where nulling all FK values can also sever other relationships. Since a composite FK is null if any part is null, we avoid nulling the properties that are also shared with another foreign key.
@ajcvickers ajcvickers force-pushed the OverlapOverflap0329 branch from 3512777 to e34242e Compare April 2, 2021 21:21
@ajcvickers
Copy link
Contributor Author

@AndriySvyryd Pushed a new version

@ajcvickers ajcvickers requested a review from AndriySvyryd April 2, 2021 21:22
Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I'd still prefer either reducing the responsibilities of GetPropertiesWithMinimalOverlapIfPossible to shorten the name or making it an Internal extension method

@ajcvickers
Copy link
Contributor Author

I'll make it an internal extension method.

@ajcvickers ajcvickers merged commit cff229a into main Apr 3, 2021
@ajcvickers ajcvickers deleted the OverlapOverflap0329 branch April 3, 2021 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set nullable properties of a composite foreign key to null when OnDeleteBehavior is ClientSetNull
2 participants