Skip to content

Upgrade guide: say that Migrate() fails until the 5.5.0 upgrade migration exists #152

Closed

Description

@CaffeinatedCoder

Found in the 5.5.0 pre-tag review (#36).

docs/upgrading.md, "Changed answers in 5.5.0", opens:

Most of these make the first migrations add after the upgrade drop and re-create some indexes or constraints. On every provider the model's CustomIndex:RenderingVersion becomes 3, …

It does not say what an application that upgrades without scaffolding gets. The 5.4.0 section does:

has-pending-model-changes reports changes and Migrate() raises EF Core's pending-model-changes error

The 5.5.0 section has more changed answers than 5.4.0 did: #88, #93, #68, #70, #72, #94 and the version mark.

Reproduction

  1. Take an app on 5.4.x whose snapshot was scaffolded with rendering version 2 and that holds any of the 5.5.0 changed answers. A model that only declares PostgreSQL constraints is enough, since it gets the version key for the first time.
  2. Bump the package to 5.5.0, for example through Dependabot, and deploy without running migrations add.
  3. At startup, Migrate() throws EF Core 9+'s PendingModelChangesWarning error. HasDifferences routes through GetDifferences, so the version change counts as a model change.

Should

The 5.5.0 introduction should carry the same sentence as 5.4.0: until the upgrade migration exists, has-pending-model-changes reports changes and Migrate() raises EF Core's pending-model-changes error.

Proposed fix

Add that sentence to the 5.5.0 introduction. This is a docs-only change.

Activity

  1. added this to the 5.5.0 milestone on Oct 20, 2026
  2. added
    documentation
    package/core
    area/migrations
    on Oct 20, 2026
  3. CaffeinatedCoder commented on Oct 20, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Measured while fixing this (#159): the rendering version alone is not a pending change. A snapshot at rendering version 2, or with no version (a constraint-only model), diffed against the version-3 model with no changed answer yields no operation. HasDifferences is false and Migrate() does not raise. So reproduction step 1's "a model that only declares PostgreSQL constraints is enough" does not hold. The error comes only with an actual changed answer. #159 says both.

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/migrationsdocumentationpackage/core

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions