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

Avoid cascade cycles on SQL Server for derived-type referencing many-to-many #28937

Merged
merged 3 commits into from
Sep 2, 2022

Conversation

ajcvickers
Copy link
Member

Fixes #28633

@ajcvickers ajcvickers requested a review from a team August 31, 2022 19:55
@ajcvickers
Copy link
Member Author

@AndriySvyryd I just realized that maybe we should only do this when both types are mapped to the same table? So, for TPH? Or would it be a cycle anyway?

@AndriySvyryd
Copy link
Member

I just realized that maybe we should only do this when both types are mapped to the same table? So, for TPH?

Yes, just TPH

@AndriySvyryd
Copy link
Member

In fact, the check should only be about the tables, not inheritance, as both principals could be table-sharing.

@AndriySvyryd
Copy link
Member

Or would it be a cycle anyway?

For TPT it wouldn't be cycle, but multiple paths, which also fails.

@ajcvickers
Copy link
Member Author

@AndriySvyryd New version up.

var inverseSkipNavigation = skipNavigation.Inverse!;

var deleteBehavior = DefaultDeleteBehavior(skipNavigation);
var inverseDeleteBehavior = DefaultDeleteBehavior(inverseSkipNavigation);
Copy link
Member

Choose a reason for hiding this comment

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

Probably a corner case, but the inverse nav could already be configured as ClientCascade explicitly, so we wouldn't need to do anything

@ajcvickers ajcvickers merged commit eb49719 into release/7.0 Sep 2, 2022
@ajcvickers ajcvickers deleted the SubSandwichDonut0831 branch September 2, 2022 09:11
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.

Self-referencing many-to-many between TPH subtypes creates cascade cycles
2 participants