Repository navigation
Description
Found while writing the 5.x reader for exclusion constraints (#92).
Problem
The planner reads its own annotations and, since #92, an earlier package's annotation that has a registered reader. Every other annotation of EFCore.ComplexIndexes 5.x in a model snapshot is passed over without a word: CustomIndex:* on an entity type (expression and JSON-member indexes, typed filters) and the temporal constraints and foreign keys of CustomTemporal:*.
A project that moves before those readers exist (#27, #18, #29) gets a first migration that looks right and is not:
- An index 5.x built is not in the source side of the diff. Declared again with SchemaKit it is created a second time, which fails at apply on the name, or under a new default name silently leaves the old one in place beside it.
- An object the consumer removes from the model is never dropped.
Neither is an error at migrations add. That is the failure this package exists to prevent.
Change
The source side of a diff refuses an entity type or model that carries an annotation of a known earlier format for which no reader is registered, naming the annotation and the package version that reads it. The list of names is 5.x's and is finished; CustomTemporal:SuppressAutoExtension, which the PostgreSQL package reads, and CustomIndex:RenderingVersion are on it as read.
A reader then removes its annotation from the list by being registered, so the guard needs no edit when #27 and the temporal handover land.
Done when
- A 5.x snapshot with an index annotation fails
migrations addwith that message, on every provider. - The fixture of PgExclusion: the 5.x reader, and a 5.x snapshot with exclusion constraints hands over with no operations #92, which holds exclusion constraints only, still diffs to nothing.
- The guard is shown to fail without the list entry for each annotation name.
Activity