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

[release/7.0] Avoid circular dependency for unique indexes with null values #29921

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

AndriySvyryd
Copy link
Member

Port of #29796
Fixes #29647

Description

When SaveChanges performs the topological sort of the update commands it considers duplicate values for unique indexes as invalid and throws an exception. However, in many database providers duplicate null values are allowed for unique indexes.

Customer impact

Affected apps throw during SaveChanges for duplicate null values. The workaround is to add a filter to every unique index in the model and then manually edit the migration to avoid rebuilding the indexes.

How found

Multiple customer reports on 7.0

Regression

Yes.

Testing

Added tests for the affected scenario.

Risk

Medium; the fix considerably changes the implementation, but a quirk was added to revert back to older behavior.

@ajcvickers ajcvickers added this to the 7.0.x milestone Dec 23, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.x, 7.0.3 Jan 4, 2023
@wtgodbe wtgodbe merged commit b9f27aa into release/7.0 Jan 4, 2023
@wtgodbe wtgodbe deleted the Issue29647 branch January 4, 2023 18:34
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