Document migration locking#5330
Merged
AndriySvyryd merged 5 commits intomainfrom Apr 16, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/dotnet/EntityFramework.Docs/sessions/a96053e2-50e2-479a-8d0d-fb9bd8bd5c9d Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update documentation for migration locking handling
Document migration locking
Apr 14, 2026
There was a problem hiding this comment.
Pull request overview
Adds missing EF Core 9 documentation for the migrations concurrency/locking mechanism (the previously un-targeted aka.ms/efcore-docs-migrations-lock concept), and updates related pages to cross-reference the new authoritative section.
Changes:
- Add a new Migration locking section to the “Applying migrations” documentation, including provider-specific behavior (SQL Server vs SQLite), abandoned-lock remediation, and explicit-transaction interaction.
- Update cross-references in EF9 “What’s New”, SQLite limitations, and data seeding docs to point to the new section.
- Add SQLite guidance (including a SQL snippet) for clearing abandoned migration locks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md | Adds a forward link from the EF9 release notes to the new migration locking documentation section. |
| entity-framework/core/providers/sqlite/limitations.md | Updates the SQLite “Concurrent migrations protection” section to reference the new docs and includes a remediation SQL snippet. |
| entity-framework/core/modeling/data-seeding.md | Updates the seeding docs to reference migration locking via the new canonical link. |
| entity-framework/core/managing-schemas/migrations/applying.md | Introduces the new “Migration locking” documentation section with details, examples, and mitigation guidance. |
…, make code sample self-contained Agent-Logs-Url: https://github.com/dotnet/EntityFramework.Docs/sessions/746024ca-0b2a-4a41-aae0-d72cadbd0353 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
roji
approved these changes
Apr 16, 2026
Member
roji
left a comment
There was a problem hiding this comment.
LGTM but see comments/suggestions.
…lify transaction section Agent-Logs-Url: https://github.com/dotnet/EntityFramework.Docs/sessions/37325281-a3df-43c1-95d6-2fb1a37c55c9 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
…void 'gotchas' Agent-Logs-Url: https://github.com/dotnet/EntityFramework.Docs/sessions/8ff97942-e08a-4cb3-99c5-0b1bcf2ebed1 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
roji
pushed a commit
to roji/EntityFramework.Docs
that referenced
this pull request
Apr 30, 2026
Fixes dotnet#4783 Co-authored-by: AndriySvyryd <6539701+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.
EF Core 9 introduced a migration locking mechanism (dotnet/efcore#34115, dotnet/efcore#34338) that was never properly documented. The
aka.ms/efcore-docs-migrations-locklink had no target content.New section in
applying.md: Migration lockingdotnet ef database update,Update-Database, bundles,MigrateAsync()/Migrate()— not SQL scripts[!WARNING]block alerts readers that locking varies across providers and can involve provider-specific issues (e.g. SQLite abandoned locks)MigrateAsyncin an explicit transaction is not supported (links to the EF9 breaking change note) and that SQLite abandoned locks can block subsequent migrations (links to SQLite limitations)SQLite limitations (
sqlite/limitations.md): Expanded "Concurrent migrations protection"__EFMigrationsLocktable (vs. SQL Server's session-levelsp_getapplock)Cross-reference updates
data-seeding.md: migration locking link now points to new section instead of whatsnewwhatsnew.md(EF9): added forward link to new docs