Repository navigation
Closed
Labels
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringenhancementNew feature or requestpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)
Milestone
Description
Part of preview.1, and the first slice of #7 and #9, which stay open for what is listed at the end. Plan, sections 3.4, 3.6, 3.7 and 3.10.
Problem
The host splices what a planner returns, and the only planner is the tests' stand-in. There is no type a declaration could be, nowhere to store one, and no contract a contributor could implement. The two belong together: a declaration is stored as a contributor's value, and the store's key rule is the contract's identity rule.
Change
In src/CodoMetis.EFCore.SchemaKit, public and [Experimental("SK9001")]:
ISchemaObjectandISchemaDeclaration<TSelf>, the codec as static abstract members, so the read model needs no service provider.- The store on
IMutableEntityType:Declare,Redeclare,GetDeclarations<T>(),FindDeclaration<T>(name).Declareasks for the wiring stamp first. - The key rule:
CodoMetis:{Owner}:{hash}, over kind and explicit name when named, over kind and every non-operational property when not.Declarethrows on a key that is taken;Redeclarecomputes every resulting key before it changes anything. - The stored value: a hand-written JSON writer with a fixed order,
$kind, the format versionv, the resolution epochr. Nothing is omitted but a null, and the reader has no default. ISchemaContributor,SchemaContributor<TDeclaration, TDescriptor>with its dependencies record,ISchemaDescriptorwithScope,NameandDependencies, the closedSchemaChange,Impact,BaseChange,Dependency,NameClaimandSchemaPlacement.PlanandImpactOfare mandatory.- A registration that adds a contributor without touching the two EF services.
Done when
- The contract probes hold against the shipping assembly: rendering from a declaration, a missed case of one's own union, a raw name in DDL, a contributor without
PlanorImpactOf, a foreign case of a kernel union. - Every declaration of a sample contributor round-trips through its annotation exactly, and through a real generated snapshot compiled with Roslyn, on the three providers.
- A convention test holds the omitted-default rule for the writer as a whole.
PublicSurfaceTestslists the new types, all experimental.- Each rule is shown to fail its tests when it is removed.
Not in this slice
- The resolver (SchemaResolver: paths to columns and SQL, identically on both sides of a diff #43), the planner that calls contributors (Change planning and impact: SchemaChange, BaseChange, ImpactOf, dependencies #24), validation and name claims at diff (Validation and diagnostics: name claims across kinds, every finding at once #44).
- The 5.x readers and the round trip of a real 5.x snapshot (Spike C: a 5.x snapshot hands over with zero operations #18, Legacy replay: migrations scaffolded by 5.x apply to a fresh database #28), which SchemaKit: snapshot format v2 and CodoMetis: annotation keys ship in 11.0.0; the 5.x format is read forever (D11) #9 asks for.
- The built-in features as contributors (PgExclusion: exclusion constraints end to end #25, PgIndex: typed indexes with expression and JSON-member keys and typed filters #27, SqlServerIndex: clustered and nonclustered, typed #29) and the page on writing a contributor, which SchemaKit: the contributor contract, so packages add schema objects instead of replacing EF services #7 asks for.
- The provider markers and
DeclarePostgres/DeclareSqlServer(PgExclusion: exclusion constraints end to end #25, SqlServerIndex: clustered and nonclustered, typed #29).
Metadata
Metadata
Assignees
Labels
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringenhancementNew feature or requestpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)
Activity
fix: a Read that changes the declaration is refused, and the store's …