Skip to content

Document recording the latest migration id in the model snapshot#5270

Merged
roji merged 3 commits intodotnet:preview-3from
roji:RecordLastestMigrationId
Feb 20, 2026
Merged

Document recording the latest migration id in the model snapshot#5270
roji merged 3 commits intodotnet:preview-3from
roji:RecordLastestMigrationId

Conversation

@roji
Copy link
Member

@roji roji commented Feb 18, 2026

@AndriySvyryd AndriySvyryd removed their assignment Feb 20, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request documents a new EF Core 11 feature that records the latest migration ID in the model snapshot, helping teams detect diverged migration trees when working on separate branches. The documentation addresses issue #37688 by explaining how this feature helps prevent merge conflicts and provides guidance on resolving them.

Changes:

  • Added documentation for the new "Latest migration ID recorded in model snapshot" feature in the EF Core 11.0 what's new page
  • Significantly revised the "Migrations in Team Environments" guide to focus on detecting and resolving diverged migration trees
  • Removed detailed merge conflict examples in favor of clearer guidance on the new automatic conflict detection mechanism

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md Added new section documenting the migration snapshot feature under the Migrations section, with cross-reference to the team environments documentation
entity-framework/core/managing-schemas/migrations/teams.md Completely restructured to focus on the new diverged migration tree detection feature, updated date, simplified resolution steps, and added preview notice
Comments suppressed due to low confidence (2)

entity-framework/core/managing-schemas/migrations/teams.md:10

  • There is a repeated word "when" in the sentence. It should read "When working with Migrations in team environments, problems can arise when migrations are added by multiple developers" (removing the duplicate "when").
When working with Migrations in team environments, problems can arise when when migrations are added by multiple developers around the same time; recall that migrations aren't simply SQL scripts, but also include a snapshot of the model at the time of that migration. Possible issues include:

entity-framework/core/managing-schemas/migrations/teams.md:22

  • The product name is inconsistent here. Line 20 uses "EF Core 11" in the NOTE block, but line 22 uses "EF 11". Based on the codebase convention (see entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md:182, entity-framework/core/providers/cosmos/saving.md:17, entity-framework/core/providers/cosmos/saving.md:21), the full "EF Core 11" should be used at the start of a sentence or when first introducing the feature, while "EF 11" is acceptable in subsequent references. However, since line 22 is the first mention in this section's body text (after the NOTE), it should use "EF Core 11" for consistency.
Starting with EF 11, the model snapshot records the ID of the latest migration. This means that if two developers each create a migration on separate branches, merging those branches will produce a source control conflict in the model snapshot file — since both branches modify the latest migration ID. This conflict is an important signal: it tells you that the migration trees have diverged, and one of them must be discarded before proceeding.

roji and others added 2 commits February 20, 2026 08:04
Co-authored-by: Andriy Svyryd <AndriySvyryd@users.noreply.github.com>
@roji roji merged commit a7d6a22 into dotnet:preview-3 Feb 20, 2026
4 checks passed
@roji roji deleted the RecordLastestMigrationId branch February 20, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments