You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrade guide: say that Migrate() fails until the 5.5.0 upgrade migration exists #152
area/migrationsThe differs, snapshot format, EnsureCreated and design-time wiringdocumentationImprovements or additions to documentationpackage/coreAffects EFCore.ComplexIndexes
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
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.
Bump the package to 5.5.0, for example through Dependabot, and deploy without running migrations add.
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.
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.
area/migrationsThe differs, snapshot format, EnsureCreated and design-time wiringdocumentationImprovements or additions to documentationpackage/coreAffects EFCore.ComplexIndexes
Activity
CaffeinatedCoder commentedon Oct 20, 2026
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.
HasDifferencesis false andMigrate()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.