Skip to content

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

Open
roji wants to merge 1 commit intodotnet:preview-3from
roji:RecordLastestMigrationId
Open

Document recording the latest migration id in the model snapshot#5270
roji wants to merge 1 commit intodotnet:preview-3from
roji:RecordLastestMigrationId

Conversation

@roji
Copy link
Member

@roji roji commented Feb 18, 2026

migration before sharing it.
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:

## Merging
Copy link
Member Author

Choose a reason for hiding this comment

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

@AndriySvyryd I removed this previous section of the docs, maintaining a harsher stance towards merging; following the previous instructions, you would indeed have a correct latest model snapshot (assuming the two conflicting migrations didn't change the exact same area of the model); however, the new migration would still have an incorrect model snapshot (without the changes from the previously-merged one), so IIUC if a user later rolled back to it and generated a new migration, things would get corrupt.

Let me know if this all makes sense to you... I think the new, simpler guidance is healthier - do not attempt to merge, but rather always roll back and recreate. We make this much simpler to detect in 11 with the new migration ID feature.

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