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
Two legacy readers for one annotation read an object twice, and the migration drops what the model still declares #108
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringbugSomething isn't workingpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)severity/lowCosmetic, message or documentation-level differencesilentAnswers wrongly without throwing; the fix ships as a minor, never a patch
Reproduced 2026-11-16 on main @ 1690320. The body below says "read against the code, not run". Run, with a second reader class for the annotation of the kernel tests' OldGuardReader (Old:Guard) and the diff from LegacyModels.InTheOldFormat to LegacyModels.Declared, which declares the same object:
the migration is DROP INDEX ux_animal;
the diff of the model against itself after it is empty.
A reader says its annotation only once it is made (Annotation is an instance member), so the check cannot sit in AddLegacyDeclarationReader: it is the planner's, where the readers are first asked for.
Found by the pre-preview sweep of main @ 948496a (GPT's read of the kernel); read against the code, not run.
What happens
AddLegacyDeclarationReader<TReader>() adds a reader once per class (TryAddEnumerable, SchemaKitServiceCollectionExtensions.cs:101). Two reader classes that name the same annotation are both kept. The planner asks every reader for the entity type's annotation (SchemaOperationPlanner.cs:349-362), so the object comes out of the source twice. The target declares it once: one copy pairs with it and the other is left, and what is left on the source side is dropped (:174).
The migration drops an object the model still declares, and the next diff is empty.
It takes two packages that both read one earlier format, or one package that registers two classes for it. Nothing does today: the only reader is ComplexIndexes5xExclusionReader.
Change
The planner, or the registration, refuses two readers for one annotation, naming both. One annotation has one reader, as one owner has one contributor.
Test
LegacyDeclarationReaderTests: a second reader class for the annotation of the first is refused, shown to fail without the check.
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringbugSomething isn't workingpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)severity/lowCosmetic, message or documentation-level differencesilentAnswers wrongly without throwing; the fix ships as a minor, never a patch
Activity