Skip to content

Breaking change note: a filtered index no longer replaces the index on a foreign key - #5525

Draft
ajcvickers wants to merge 4 commits into
dotnet:mainfrom
ajcvickers:breaking-change-filtered-index-fk-index
Draft

ajcvickers wants to merge 4 commits into
dotnet:mainfrom
ajcvickers:breaking-change-filtered-index-fk-index

Conversation

@ajcvickers

@ajcvickers ajcvickers commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Adds a breaking change note to the EF Core 12 breaking changes page for dotnet/efcore#39652 (fixes dotnet/efcore#24237).

An index with a filter, that starts with a foreign key's properties and has more properties after them, no longer counts as covering the foreign key, so the foreign key's own index is created, and the next migration contains a CreateIndex for it. An index on exactly the foreign key's properties is still the foreign key's index, and a filter set by convention (such as SQL Server's filter on unique indexes over nullable columns) still covers the foreign key unless it excludes rows with nulls in columns that aren't foreign key columns.

Draft until dotnet/efcore#39652 merges. Like the other open breaking change PRs, this adds ef-core-12.0/breaking-changes.md, so whichever merges second needs a trivial merge of the page.

🤖 Generated with Claude Code

ajcvickers and others added 4 commits November 14, 2026 16:47
…gn key index

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nal behavior

An index on exactly the foreign key's properties is always the foreign key's
index, and a convention-set filter now only prevents an index covering the
foreign key if it excludes rows with nulls in columns that aren't foreign key
columns. The convention API is now IsPartial(index, properties) and
OnIndexCoverageChanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ter regeneration

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…olumns

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

EF Core migration drops existing index on a column when a composite filtered index on that column is added

1 participant