You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Planner, second slice: EF Core's operations as BaseChange, ImpactOf asked and acted on, and an unknown operation type refused #65
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringenhancementNew feature or requestpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)
The second slice of #24, which stays open for the rest.
Problem
The planner (#63) compares the declarations of two models and does not look at what EF Core does between them. An object both models declare unchanged is left alone, also when an operation of EF Core's removes it (SQLite's table rebuild, a dropped column under raw SQL) or cannot run while it exists (SQL Server's ALTER COLUMN under an index). The first is a migration that applies cleanly and leaves the database without what the model declares.
Change
EF Core's operations become BaseChanges. A table of every MigrationOperation type in EF Core Relational and the three providers maps each to a change or marks it harmless. On SQLite an operation the provider rebuilds the table for is also TableRebuilt.
An operation type outside the table is refused when either model declares a SchemaKit object: what it does to them is unknown.
ImpactOf is asked for every source descriptor and every change that touches what it depends on (a column, the whole table, its scope), and the worst answer decides:
RebuildAround: dropped before EF Core's operations and created after them, also when both sides are equal. Plan is not asked.
Lost: not dropped; created after when the target still declares it.
Follows and Unaffected: as before.
A table EF Core renames is the same table for this: a change on the renamed table reaches a descriptor that names the old one.
Ordering by Dependency.SchemaObject, and deleting the stand-in planner in Harness/TestKit.cs.
A way for another package to tell SchemaKit what its own operation type does.
Done when
On a live SQLite database, an index both models declare is still there after a migration whose AlterColumn rebuilt the table.
A convention test fails when an assembly gains a MigrationOperation type the table does not know, and another when SQLite rebuilds a table for an operation the kernel does not take for one.
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringenhancementNew feature or requestpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)
Activity