Repository navigation
Description
2026-11-12, the name claims are #96 (PR #97): NameClaims in the planner, ISchemaDialect.Claims for EF Core's own objects, SchemaDiagnostic.NameCollision (SK1001) and SchemaValidationException with every finding at once, target only. The seed #84 left open (the constraint's name carrying its table's schema) now fails a test. All at once is implemented and still to be confirmed. Open here: ids for the kernel's existing refusals, warnings through the diagnostics logger, DeclarationRef (the diagnostic holds text for now), SQL Server's scopes (with #29), identifier-limit and whole-table findings as diagnostics.
From #84, 2026-11-12: PgExclusionContributor gives its descriptor a name without a schema, since a constraint is named within its table. A seeded defect that qualifies the name with the table's schema passes every test today: it changes no statement and no match. It will change what the name claims say, so the test for it comes with this issue.
A gap in the backlog, found while writing the handoff of 2026-11-11: validation is described in the design (section 9.8) and assumed by #7, #24 and #25, and no issue owns it.
Problem
What the types cannot forbid has to be reported at migrations add, EnsureCreated() and the pending-changes check: a name used twice, an identifier over the limit, a rule of the whole table. 5.x grew these checks one kind at a time, and each compared a kind with itself, which is not how PostgreSQL scopes names: a same-named exclusion constraint replaced a temporal one without an error.
Change
NameClaim, a closed union of the namespaces a name occupies:Relation(schema, name),TableIndex(table, name),Constraint(table, name),Trigger(table, name). Each descriptor returns its claims; EF's own tables, indexes, keys and constraints are entered too; a collision is reported only when one party is SchemaKit's. Names compare by the provider's rule.SchemaDiagnostic, a closed union with a stable id per finding (SK1001name collision, …), each carrying the declaration it is about.- All at once: every finding of the target model in one
SchemaValidationException. The draft's open question Q7 assumes yes; confirm with the maintainer. - Target only: a snapshot that already holds a collision stays diffable.
- The exceptions the kernel throws today as
InvalidOperationExceptionwith a text fromSchemaKitStrings(the wiring guards, the dialect's checks) get ids of the same scheme. - Warnings go through
IDiagnosticsLogger<DbLoggerCategory.Migrations>with event ids, soConfigureWarningscan raise them.
Done when
- A collision across two kinds (an index and an exclusion constraint of one name) and one with an EF-owned object are each reported with both parties named, on PostgreSQL and SQL Server scopes.
- Two findings in one model arrive in one exception.
- A collision that exists only in the snapshot does not stop a diff.
Activity
CaffeinatedCoder commentedon Nov 14, 2026
From the pre-preview sweep of
main@ 948496a, 2026-11-14. #100 is the null schema againstpublic, and #99 the name a rename frees too late, which the end-state check cannot see. Two more leads, read and not run:{table}_{column}_seq, a relation of the schema. A constraint of that name fails at apply (42P07).Checked and sound:
SK1001cannot fire on a model without a SchemaKit declaration (nothing is checked when the target declares nothing, and the pairs start from SchemaKit's own claims); one constraint name on two tables, a check constraint against an exclusion constraint on different tables, one name in two schemas, and names that differ in case all agree with the server.