Document recording the latest migration id in the model snapshot#5270
Merged
roji merged 3 commits intodotnet:preview-3from Feb 20, 2026
Merged
Document recording the latest migration id in the model snapshot#5270roji merged 3 commits intodotnet:preview-3from
roji merged 3 commits intodotnet:preview-3from
Conversation
roji
commented
Feb 18, 2026
There was a problem hiding this comment.
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.
AndriySvyryd
approved these changes
Feb 20, 2026
Co-authored-by: Andriy Svyryd <AndriySvyryd@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See dotnet/efcore#37688