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
On SQLite a rebuild written under the table's old name is not seen: an object on a table that is renamed and rebuilt is lost in silence #193
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringbugSomething isn't workingpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)severity/mediumInconsistency or failure in a narrow scenariosilentAnswers wrongly without throwing; the fix ships as a minor, never a patch
Found while building the refusal of #145, on main @ c6dfd42 (EF Core 11.0.0), with the second provider's SQLite probe.
What happens
A check constraint is dropped from People, the table becomes Persons, and its primary key keeps its name. EF Core writes DropCheckConstraintOperation (for People) and then RenameTableOperation. SQLite's provider rebuilds the table for the first. The planner adds nothing:
The contributor is never asked about the rebuild, so the index both models declare is not created again, and the rebuild drops it with the old table. The migration applies and the snapshot still holds the declaration.
Why
BaseChanges.Touching compares a change's table with the object's tables as the target names them (Forward). A TableRebuilt carries the table as its operation names it, and an operation that stands before the rename names it as the source has it: People is compared with Persons. The operations EF Core writes before a rename are the drops of keys and constraints, each of which SQLite rebuilds for.
A fourth way into #145, and not covered by its refusal: nothing is created, so nothing is refused.
Scenario
People.IndexedWithANamedKeyAndACheck to People.TableRenamedWithANamedKey in SqliteExpressionIndexTests.
Change
A TableRebuilt names its table as the target has it, as the other changes do, whichever side of the rename its operation stands on.
Test
A_rebuild_written_for_the_table_under_its_old_name_is_refused_too: with the fix the object is to be created again, and #145's refusal says so at the diff.
Fixed on fix/145-sqlite-rebuild-refusal with #145: BaseChanges.Of names a TableRebuilt's table as the target has it. A_rebuild_written_for_the_table_under_its_old_name_is_refused_too fails with the fix taken out (the planner writes nothing and nothing is refused) and passes with it.
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringbugSomething isn't workingpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)severity/mediumInconsistency or failure in a narrow scenariosilentAnswers wrongly without throwing; the fix ships as a minor, never a patch
Activity
CaffeinatedCoder commentedon Nov 25, 2026
Fixed on
fix/145-sqlite-rebuild-refusalwith #145:BaseChanges.Ofnames aTableRebuilt's table as the target has it.A_rebuild_written_for_the_table_under_its_old_name_is_refused_toofails with the fix taken out (the planner writes nothing and nothing is refused) and passes with it.