Skip to content

Fix IsTableExcludedFromMigrations default for entity splitting. - #38802

Open
AndriySvyryd wants to merge 1 commit into
mainfrom
Issue38780
Open

Fix IsTableExcludedFromMigrations default for entity splitting.#38802
AndriySvyryd wants to merge 1 commit into
mainfrom
Issue38780

Conversation

@AndriySvyryd

Copy link
Copy Markdown
Member

Fixes #38780

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes the default ExcludeFromMigrations behavior for entity-splitting mapping fragments so that a split table does not implicitly inherit the main table’s excluded-from-migrations setting unless it was explicitly configured on that fragment. This aligns migration diffing behavior with the per-table nature of entity splitting.

Changes:

  • Update RelationalEntityTypeExtensions.IsTableExcludedFromMigrations(entityType, storeObject) so mapping fragments default to false when no explicit exclusion is configured.
  • Add a regression test ensuring that removing entity splitting still produces DropTable/CreateTable operations for the split table even when the main table is excluded from migrations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/EFCore.Relational.Tests/Migrations/Internal/MigrationsModelDifferTest.cs Adds a regression test covering entity splitting removal when the main table is excluded from migrations.
src/EFCore.Relational/Extensions/RelationalEntityTypeExtensions.cs Fixes mapping-fragment exclusion default to avoid inheriting the entity’s main table exclusion.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

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.

Entity splitting propagates ExcludeFromMigrations incorrectly

2 participants