From 8a7d0aabc4c86c554bc6d0047140688250594392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Say=C4=B1n?= Date: Sat, 27 Jun 2026 01:00:16 +0300 Subject: [PATCH 1/2] Add note about EF Core 9 PendingModelChangesWarning behavior in managing Cross-references the new EF Core 9 runtime behavior (where Migrate() throws an exception when pending changes exist) from the "Checking for pending model changes" section. This complements PR #5390 which added a note in applying.md, completing the cross-page documentation flow. --- entity-framework/core/managing-schemas/migrations/managing.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entity-framework/core/managing-schemas/migrations/managing.md b/entity-framework/core/managing-schemas/migrations/managing.md index 2f903799bd..13a45b9c1f 100644 --- a/entity-framework/core/managing-schemas/migrations/managing.md +++ b/entity-framework/core/managing-schemas/migrations/managing.md @@ -221,6 +221,9 @@ dotnet ef migrations has-pending-model-changes You can also perform this check programmatically using `context.Database.HasPendingModelChanges()`. This can be used to write a unit test that fails when you forget to add a migration. +> [!NOTE] +> Starting with EF Core 9, an exception is thrown automatically when `Migrate()` or `MigrateAsync()` is called with pending model changes (warning event ID `RelationalEventId.PendingModelChangesWarning`). See the [applying migrations documentation](xref:core/managing-schemas/migrations/applying#apply-migrations-at-runtime) and the [breaking change note](xref:core/what-is-new/ef-core-9.0/breaking-changes#pending-model-changes) for more information. + ## Resetting all migrations In some extreme cases, it may be necessary to remove all migrations and start over. This can be easily done by deleting your **Migrations** folder and dropping your database; at that point you can create a new initial migration, which will contain your entire current schema. From 80ebd4f13ad28d2482dc1be68f94962659fa610a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Say=C4=B1n?= Date: Tue, 7 Jul 2026 23:44:57 +0300 Subject: [PATCH 2/2] Potential fix for pull request finding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applied the Copilot suggestion. Ready for another look whenever you have time — thanks! Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- entity-framework/core/managing-schemas/migrations/managing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/core/managing-schemas/migrations/managing.md b/entity-framework/core/managing-schemas/migrations/managing.md index 13a45b9c1f..5bba197abf 100644 --- a/entity-framework/core/managing-schemas/migrations/managing.md +++ b/entity-framework/core/managing-schemas/migrations/managing.md @@ -222,7 +222,7 @@ dotnet ef migrations has-pending-model-changes You can also perform this check programmatically using `context.Database.HasPendingModelChanges()`. This can be used to write a unit test that fails when you forget to add a migration. > [!NOTE] -> Starting with EF Core 9, an exception is thrown automatically when `Migrate()` or `MigrateAsync()` is called with pending model changes (warning event ID `RelationalEventId.PendingModelChangesWarning`). See the [applying migrations documentation](xref:core/managing-schemas/migrations/applying#apply-migrations-at-runtime) and the [breaking change note](xref:core/what-is-new/ef-core-9.0/breaking-changes#pending-model-changes) for more information. +> Starting with EF Core 9, calling or with pending model changes throws an exception (event ID ). See the [applying migrations documentation](xref:core/managing-schemas/migrations/applying#apply-migrations-at-runtime) and the [breaking change note](xref:core/what-is-new/ef-core-9.0/breaking-changes#pending-model-changes) for more information. ## Resetting all migrations