Skip to content

Expand and clarify migrations guidance. - #5445

Open
AndriySvyryd wants to merge 3 commits into
mainfrom
Migrations
Open

Expand and clarify migrations guidance.#5445
AndriySvyryd wants to merge 3 commits into
mainfrom
Migrations

Conversation

@AndriySvyryd

Copy link
Copy Markdown
Member

Fixes #736
Fixes #1043
Fixes #2952
Fixes #3258
Fixes #3425
Fixes #3426
Fixes #3444
Fixes #933
Fixes #3835
Fixes #5323
Fixes #4954
Fixes #4914
Fixes #4913
Fixes #4924
Fixes #4768
Fixes #4703
Fixes #4650
Fixes #4332
Fixes #4318
Fixes #4304
Fixes #4266
Fixes #4230
Fixes #3724
Fixes #3560
Fixes #3061
Fixes #3418
Fixes #2355
Fixes #2270
Fixes #2147
Fixes #1879
Fixes #1342
Fixes #807
Fixes #691
Fixes #564

Fixes #736
Fixes #1043
Fixes #2952
Fixes #3258
Fixes #3425
Fixes #3426
Fixes #3444
Fixes #933
Fixes #3835
Fixes #5323
Fixes #4954
Fixes #4914
Fixes #4913
Fixes #4924
Fixes #4768
Fixes #4703
Fixes #4650
Fixes #4332
Fixes #4318
Fixes #4304
Fixes #4266
Fixes #4230
Fixes #3724
Fixes #3560
Fixes #3061
Fixes #3418
Fixes #2355
Fixes #2270
Fixes #2147
Fixes #1879
Fixes #1342
Fixes #807
Fixes #691
Fixes #564

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR expands and clarifies EF Core migrations guidance across multiple docs pages, and adds/updates samples to support the recommended workflows (separate migrations project, migration bundles, data operations in migrations, and corrected custom operation SQL generation).

Changes:

  • Improve migrations documentation around team workflows, deployment strategies (scripts vs bundles vs tooling), and separate migrations projects.
  • Add new samples for a migration bundle workflow and for design-time DbContext creation in a separate migrations project.
  • Fix and extend sample code used in docs (e.g., custom migration operation type mapping, new data-operations snippets).

Reviewed changes

Copilot reviewed 25 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
samples/core/Schemas/ThreeProjectMigrations/WebApplication1/WebApplication1.csproj Simplifies reference to migrations project for the 3-project sample.
samples/core/Schemas/ThreeProjectMigrations/WebApplication1.Migrations/WebApplication1.Migrations.csproj Adds EF design-time and provider packages to support tooling in migrations project.
samples/core/Schemas/ThreeProjectMigrations/WebApplication1.Migrations/ApplicationDbContextFactory.cs Adds design-time factory used by docs/tools for separate migrations project.
samples/core/Schemas/ThreeProjectMigrations/WebApplication1.Data/WebApplication1.Data.csproj Updates package versions to align with the sample’s target framework/version set.
samples/core/Schemas/Migrations/DataOperations.cs Adds migration data-operation examples for docs snippets.
samples/core/Schemas/Migrations/CustomOperation.cs Fixes string type mapping acquisition in custom operation sample.
samples/core/Schemas/MigrationBundle/Program.cs Adds a small verification entrypoint for the migration bundle sample.
samples/core/Schemas/MigrationBundle/Migrations/BloggingContextModelSnapshot.cs Adds model snapshot for the migration bundle sample.
samples/core/Schemas/MigrationBundle/Migrations/20260805232730_AddIsActive.Designer.cs Adds generated designer for the second migration in the bundle sample.
samples/core/Schemas/MigrationBundle/Migrations/20260805232730_AddIsActive.cs Adds the second migration in the bundle sample.
samples/core/Schemas/MigrationBundle/Migrations/20260805232705_InitialCreate.Designer.cs Adds generated designer for the initial migration in the bundle sample.
samples/core/Schemas/MigrationBundle/Migrations/20260805232705_InitialCreate.cs Adds the initial migration in the bundle sample.
samples/core/Schemas/MigrationBundle/MigrationBundle.csproj Introduces a new sample project for migration bundles.
samples/core/Schemas/MigrationBundle/BloggingContextFactory.cs Adds design-time factory for the bundle sample context.
samples/core/Schemas/MigrationBundle/BloggingContext.cs Adds a context with seeding delegates and schema-existence checks for rollback safety.
samples/core/Schemas/MigrationBundle/Blog.cs Adds the sample entity type.
samples/core/Samples.sln Registers the new MigrationBundle project in the samples solution.
entity-framework/core/modeling/data-seeding.md Clarifies seeding behavior during deployment/migrations and links to bundle/script tradeoffs.
entity-framework/core/managing-schemas/migrations/teams.md Adds guidance for diverged migration trees and source-control rollbacks.
entity-framework/core/managing-schemas/migrations/projects.md Rewrites/expands separate migrations project guidance with a 3-project layout and tooling commands.
entity-framework/core/managing-schemas/migrations/operations.md Adds guidance pointing readers at built-in data operations before custom operations.
entity-framework/core/managing-schemas/migrations/managing.md Expands “data operations” coverage and adds guidance for removal/listing/squashing scenarios.
entity-framework/core/managing-schemas/migrations/index.md Updates overview guidance with pointers to projects/bundles/scripts and next steps.
entity-framework/core/managing-schemas/migrations/applying.md Adds a deployment strategy matrix and expands bundle/script/environment guidance.
entity-framework/core/cli/powershell.md Adds warning clarifying Update-Database -Migration downgrade behavior.
entity-framework/core/cli/dotnet.md Adds warning clarifying dotnet ef database update <migration> downgrade behavior and --output note.
entity-framework/core/cli/dbcontext-creation.md Clarifies design-time factory precedence and updates references/links.
Files not reviewed (2)
  • samples/core/Schemas/MigrationBundle/Migrations/20260805232705_InitialCreate.Designer.cs: Generated file
  • samples/core/Schemas/MigrationBundle/Migrations/20260805232730_AddIsActive.Designer.cs: Generated file

Comment thread entity-framework/core/modeling/data-seeding.md Outdated
Comment thread entity-framework/core/cli/dbcontext-creation.md Outdated
Comment thread entity-framework/core/managing-schemas/migrations/teams.md Outdated
Copilot AI review requested due to automatic review settings August 6, 2026 23:01
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 27 changed files in this pull request and generated no new comments.

Files not reviewed (2)
  • samples/core/Schemas/MigrationBundle/Migrations/20260805232705_InitialCreate.Designer.cs: Generated file
  • samples/core/Schemas/MigrationBundle/Migrations/20260805232730_AddIsActive.Designer.cs: Generated file

@AndriySvyryd AndriySvyryd reopened this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants