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] Use the correct builder when attaching indexes on nested owned entity types #26720

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

AndriySvyryd
Copy link
Member

Fixes #26659

Description

When OwnsMany() is called for a navigation of the same CLR type the second type the target entity type is converted to a shared-type entity type. All existing components, like indexes are then reattached to the new entity type, however the incorrect entity type builder was used for nested owned entity types.

Customer impact

When a nested owned entity type has a configured index the second OwnsMany() call throws an exception. A workaround would be to configure the index after the second OwnsMany() call.

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 avoid using an entity type that's no longer in the model.

@AndriySvyryd AndriySvyryd added this to the 6.0.x milestone Nov 17, 2021
@AndriySvyryd AndriySvyryd requested a review from a team November 17, 2021 05:30
@ajcvickers ajcvickers modified the milestone: 6.0.x Nov 17, 2021
@AndriySvyryd AndriySvyryd modified the milestones: 6.0.x, 6.0.1 Nov 17, 2021
@AndriySvyryd AndriySvyryd changed the title [6.0.x] Use the correct builder when attaching indexes on nested owned entity types Use the correct builder when attaching indexes on nested owned entity types Nov 17, 2021
@AndriySvyryd AndriySvyryd merged commit 24e7b0d into release/6.0 Nov 17, 2021
@AndriySvyryd AndriySvyryd deleted the Issue26659 branch November 17, 2021 19:11
@AndriySvyryd AndriySvyryd removed this from the 6.0.1 milestone Nov 17, 2021
@ajcvickers ajcvickers changed the title Use the correct builder when attaching indexes on nested owned entity types [6.0.1] Use the correct builder when attaching indexes on nested owned entity types 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.

2 participants