Skip to content

Fix schema confusion when integrating EF Core with Marten - #4176

Merged
jeremydmiller merged 2 commits into
masterfrom
fix/4175-ef-core-schema-confusion
Mar 19, 2026
Merged

jeremydmiller merged 2 commits into
masterfrom
fix/4175-ef-core-schema-confusion

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Summary

  • Fixes Schema confusion when integrating EF Core with Marten #4175: When EF Core entities have an explicit schema configured (e.g., via HasDefaultSchema or ToTable("name", "schema")), AddEntityTablesFromDbContext no longer moves those tables into Marten's schema
  • Tables without an explicit EF Core schema continue to be moved to the Marten schema (preserving existing behavior)

Test plan

  • should_respect_ef_core_explicit_schema_and_not_move_tables_to_marten_schema — verifies tables with explicit EF Core schema stay in that schema
  • should_move_tables_without_explicit_schema_to_marten_schema — verifies existing behavior is preserved

🤖 Generated with Claude Code

jeremydmiller and others added 2 commits March 18, 2026 19:37
Respect explicit EF Core schema configuration in AddEntityTablesFromDbContext
instead of unconditionally moving all tables to Marten's schema.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit 4ebfefa into master Mar 19, 2026
6 checks passed
@jeremydmiller
jeremydmiller deleted the fix/4175-ef-core-schema-confusion branch March 19, 2026 01:20
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.

Schema confusion when integrating EF Core with Marten

1 participant