Skip to content

Pin three 5.5.0 behaviours the pre-tag seeds survived (#155, #156, #157) - #160

Merged
CaffeinatedCoder merged 3 commits into
mainfrom
tests/155-157-surviving-seeds
Oct 20, 2026
Merged

CaffeinatedCoder merged 3 commits into
mainfrom
tests/155-157-surviving-seeds

Conversation

@CaffeinatedCoder

@CaffeinatedCoder CaffeinatedCoder commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Closes #155
Closes #156
Closes #157

Problem

The 5.5.0 pre-tag review seeded 46 defects into a scratch copy, and the unit suite caught 43. These are the three it missed. Each one is behaviour a 5.5.0 fix introduced, and today's code gets each one right. But nothing pinned any of them, so the 569-test suite passed with the defect seeded back in:

Change

Test-only, so there is no changelog line.

  • SqlServerNullableUniqueTests: adds a property-level unique declaration on an optional complex property, which asserts the filter on the operation and in the rendered DDL. A required complex property with no filter is the control.

  • AlterColumnUnderIndexTests: adds a unique index on Email.Value filtered by {Note} IS NULL, where Note changes length. It asserts drop < AlterColumn Note < create. There is no PostgreSQL row because only the SQL Server satellite turns RequiresIndexRecreation on.

  • SqliteTableRebuildTests: adds two new tables with circular foreign keys, each with a complex index, scaffolded unwired. It asserts that an AddForeignKeyOperation is present and the scaffold is not refused, then applies the migration on in-memory SQLite and finds both indexes.

  • SqlServerIntegrationTests: adds two live rows.

    CustomerContext gains a NameLength virtual for the second row. Tests: nothing pins that FKs on tables created in the same migration are no SQLite rebuild #157 has no SQL Server row: it is SQLite-only, and its unit test already applies for real.

Tests

Each new test was proven by seeding the defect from its issue into src/EFCore.ComplexIndexes/CustomMigrationsModelDiffer.cs, one at a time. With each seed the full unit suite showed 1 failed / 573 passed of 574, and the one failure was the new test. Each seed was then restored.

Issue Seed Failing test and message
#155 ResolvePropertyLevelIndex: ?? ImplicitFilter(entityType, storeObject, …) → ?? null A property-level unique complex index over a nullable column gets the filter too: expected: "[Registration_Vin] IS NOT NULL", actual: null
#156 ColumnsReadBy: columns.UnionWith(table.Columns…Where(name => text.Contains(name, …))) → { } SQL Server: ALTER COLUMN on a column only the filter names runs with the index out of the way: Assert.IsTrue failed, operations AlterColumnOperation only (no drop, no create)
#157 SQLite rebuild detection: AddForeignKeyOperation foreignKey => !created.Contains(…) → => true Circular foreign keys between tables the migration creates are no rebuild: InvalidOperationException: SQLite rebuilds table 'members' for this migration (a AddForeignKey) and re-creates only the indexes EF Core knows…

Live SQL Server rows. The SQL Server image does not run on Apple Silicon here, so the rows were proven with dispatched dotnet.yml runs on two throwaway branches, which are now deleted:

After rebasing onto main (with #147 and #148), the unit suite passes 598/598. The rebase onto #148 conflicted in SqlServerIntegrationTests because both added a row in the same place. I kept both rows, and this PR's own CI runs the SQL Server lane again.

🤖 Generated with Claude Code

@CaffeinatedCoder CaffeinatedCoder added this to the 5.5.0 milestone Oct 20, 2026
@CaffeinatedCoder CaffeinatedCoder added tests Adds or changes tests only (harnesses, parity suites); no library code package/core Affects EFCore.ComplexIndexes package/sqlserver Affects EFCore.ComplexIndexes.SqlServer area/indexes Complex-property, composite, unique and filtered indexes area/migrations The differs, snapshot format, EnsureCreated and design-time wiring labels Oct 20, 2026
CaffeinatedCoder and others added 2 commits October 20, 2026 13:44
#155: a property-level unique complex index over a nullable column gets
SQL Server's IS NOT NULL filter (#88).
#156: a column only a filter names counts as read for ALTER COLUMN on
SQL Server (#84).
#157: circular foreign keys between tables created in the same migration
are no SQLite rebuild (#95).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CaffeinatedCoder
CaffeinatedCoder force-pushed the tests/155-157-surviving-seeds branch from 431b7e5 to a6ab5a0 Compare October 20, 2026 11:44
# Conflicts:
#	test/EFCore.ComplexIndexes.Tests/SqlServerIntegrationTests.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/indexes Complex-property, composite, unique and filtered indexes area/migrations The differs, snapshot format, EnsureCreated and design-time wiring package/core Affects EFCore.ComplexIndexes package/sqlserver Affects EFCore.ComplexIndexes.SqlServer tests Adds or changes tests only (harnesses, parity suites); no library code

Projects

None yet

1 participant