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.2] Handle duplicate property infos when sorting columns. #26958

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

AndriySvyryd
Copy link
Member

Fixes #26405

Description

If no explicit order is specified we determine the column order partially based on the property declaration order on the CLR types. However for down migrations the snapshot is used and it doesn't have associated CLR types. Dictionary<string,object> is used as a stand-in and all properties and navigations are mapped to the indexer. When sorting foreign key properties this causes an exception as the same property info is used as the key multiple times.

Customer impact

An exception is thrown when creating a migration for a table rename with two or more navigations. There isn't a practical workaround.

How found

Customer report on RC2. 7 reports so far.

Regression

Yes, from 5.0

Testing

This PR adds coverage for this scenario.

Risk

Low; the fix only affects column order in migrations produced during design-time. Quirk mode not added as there isn't a practical way to access the AppContext used by CLI tools.

@AndriySvyryd AndriySvyryd added this to the 6.0.x milestone Dec 10, 2021
@AndriySvyryd AndriySvyryd requested a review from a team December 10, 2021 00:20
@leecow leecow modified the milestones: 6.0.x, 6.0.2 Dec 14, 2021
@ajcvickers ajcvickers merged commit 0d35946 into release/6.0 Dec 15, 2021
@ajcvickers ajcvickers deleted the Issue26405 branch December 15, 2021 09:25
@ajcvickers ajcvickers removed this from the 6.0.2 milestone Dec 15, 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