Skip to content

Renames under Follows: the source side resolves under the names EF Core gives a renamed table and column, so what reads them is not rebuilt #69

Closed

Description

@CaffeinatedCoder

The third slice of #24, and the rename part of #43.

Problem

Impact.Follows is taken as "leave it". The source side of a diff is resolved under the names its own model has, so an object that reads a renamed column or sits on a renamed table differs from the target's and is dropped and created: a rebuild, under a lock on a large table, for a rename the database follows by itself (spike E: Follows in every rename cell but a filtered index on SQL Server and a trigger whose body reads the column).

Change

  • The resolver takes EF Core's renames. For the source side it answers with the table and the columns as the target names them: the fragment's SQL and its dependencies take the new names.
  • A default name is still built from the source's own table and columns. So an object with a default name differs from the target's in its name alone, which is the contributor's InPlace rename, as EF Core's own indexes are renamed.
  • The planner asks first, then resolves again. ImpactOf is asked with the descriptor under the old names. When every rename that touches the object is answered Follows, and nothing asks for more, the source is resolved again under the new names and that is what is matched against the target.
  • A drop is written for the object as it is before EF Core's operations, since drops run before them: under the old table and the old columns.

Done when

Through the real host: an object with an explicit name on a renamed table, on a renamed column, and on both, gives no statement; one with a default name gives one rename statement after EF Core's operations; an answer other than Follows leaves the pair to the contributor as before; a rebuild next to a rename drops under the old table. Each rule is shown to fail a test when undone.

Activity

  1. added this to the 11.0.0 milestone on Nov 12, 2026
  2. added
    enhancement
    package/core
    on Nov 12, 2026
  3. added
    area/migrations
    on Nov 12, 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/migrationsenhancementpackage/core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions