Repository navigation
Pin three 5.5.0 behaviours the pre-tag seeds survived (#155, #156, #157) - #160
Merged
Merged
Conversation
#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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
CaffeinatedCoder
force-pushed
the
tests/155-157-surviving-seeds
branch
from
October 20, 2026 11:44
431b7e5 to
a6ab5a0
Compare
# Conflicts: # test/EFCore.ComplexIndexes.Tests/SqlServerIntegrationTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
IS NOT NULLfilter on a property-level unique complex index over a nullable column, on SQL Server. SQL Server: a unique complex index over nullable columns admits only one row without a value #88's tests covered the entity-level path only.ALTER COLUMNon SQL Server, when the altered column is named only in the index's filter.AddForeignKeyon a table created in the same migration as a rebuild. Circular foreign keys between new tables produce exactly that.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 onEmail.Valuefiltered by{Note} IS NULL, whereNotechanges length. It asserts drop <AlterColumn Note< create. There is no PostgreSQL row because only the SQL Server satellite turnsRequiresIndexRecreationon.SqliteTableRebuildTests: adds two new tables with circular foreign keys, each with a complex index, scaffolded unwired. It asserts that anAddForeignKeyOperationis present and the scaffold is not refused, then applies the migration on in-memory SQLite and finds both indexes.SqlServerIntegrationTests: adds two live rows.sys.indexes, inserts two NULLs and is refused a duplicate value.{Name} <> N'', thennameshrinks from 100 to 50. The test applies both migrations, reads the filter back and checks that a duplicate is still refused.CustomerContextgains aNameLengthvirtual 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.ResolvePropertyLevelIndex:?? ImplicitFilter(entityType, storeObject, …)→?? nullexpected: "[Registration_Vin] IS NOT NULL",actual: nullColumnsReadBy:columns.UnionWith(table.Columns…Where(name => text.Contains(name, …)))→{ }Assert.IsTruefailed, operationsAlterColumnOperationonly (no drop, no create)AddForeignKeyOperation foreignKey => !created.Contains(…)→=> trueInvalidOperationException: 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.ymlruns on two throwaway branches, which are now deleted:proof/155-green(these tests): run 39416240208. Every job passed; Integration (SQL Server 2022) passed 15/15.proof/155-seeded(the same tests plus seeds Tests: nothing pins #88's IS NOT NULL filter on a property-level declaration #155 and Tests: nothing pins that a column named only in a filter counts as read for ALTER COLUMN #156): run 39416243582. Integration (SQL Server 2022) failed 2, passed 13:expected: "([Registration_Vin] IS NOT NULL)",actual: nullSqlException: The index 'ux_email_named' is dependent on column 'name'. ALTER TABLE ALTER COLUMN name failed because one or more objects access this column.This confirms on a real server that a column named only in a filter blocksALTER COLUMN.After rebasing onto main (with #147 and #148), the unit suite passes 598/598. The rebase onto #148 conflicted in
SqlServerIntegrationTestsbecause 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