Skip to content

Tests: nothing pins that a column named only in a filter counts as read for ALTER COLUMN #156

Closed

Description

@CaffeinatedCoder

Found in the 5.5.0 pre-tag review (#36) by seeding defects into 934ec55. The code is right today, but nothing pins it.

Seed: in ColumnsReadBy (src/EFCore.ComplexIndexes/CustomMigrationsModelDiffer.cs:555), replace columns.UnionWith(table.Columns.Select(c => c.Name).Where(name => text.Contains(name, …))) with { }.

Result: the unit suite still passes, 569/569.

Without that line, a column that a complex index names only in its filter no longer counts as read by the index. An ALTER COLUMN on it then runs with the index in place, and fails at apply on SQL Server (Msg 5074). Today a filter {RevokedAt} IS NULL plus a type change of RevokedAt correctly scaffolds DropIndex ux_active_email → AlterColumn RevokedAt → CreateIndex ux_active_email.

Test to add: that model, with the SQL Server differ; assert drop < alter < create. Add a PostgreSQL row if its differ shares the path. Prove it by re-applying the seed.

Activity

  1. added this to the 5.5.0 milestone on Oct 20, 2026
  2. added
    tests
    package/core
    package/sqlserver
    area/migrations
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/migrationspackage/corepackage/sqlservertests

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions