v5.0.2
What changed in 5.0.2
A review of the 5.0.1 tree turned up eleven issues. The first three produced migrations that
scaffolded and applied cleanly while being silently wrong; the rest turn late, obscure, or silent
failures into errors raised at the declaration or during dotnet ef migrations add.
- Fixed: the design-time differ is now selected deterministically. A satellite package's
DesignTimeServicesReferenceAttributeis scoped to its provider (ForProvider), and the core registration backs off when a satellite is present — previously, because the core package's attribute rides along transitively and EF resolves last-registration-wins, NuGet's restore order decided which differ ran. A solution referencing two satellites could hand one provider's model to the other provider's differ, silently dropping its index options. - Fixed: temporal
UNIQUE … WITHOUT OVERLAPSconstraints and temporal foreign keys are now rendered at design time, like exclusion constraints, and no longer needUseNpgsqlComplexIndexes(). Previously a consumer without that wiring got a plainUNIQUE (key, period)— valid DDL that applied cleanly and silently dropped the entire non-overlap guarantee. Migrations scaffolded before this change keep working: the SQL generator still renders the old stamped operations. - Fixed: exclusion-constraint identity now includes the filter, so two
EXCLUDEconstraints over the same columns with different predicates coexist (both must be named) instead of the second silently replacing the first — the filtered-overlap case the API exists for. Re-declaring with the same filter still updates in place. - Fixed: duplicate index and exclusion-constraint names are now rejected instead of producing a migration that fails at apply time (42P07) — or, for exclusion constraints, one that applies silently and leaves only the last constraint standing. Reusing an explicit name throws at the declaration; collisions between default names, or between a property-level and an entity-level declaration, throw during
migrations add. - Fixed:
CompositeIndexDefinitionequality compares array-valued provider annotations (operator classes, INCLUDE lists) by content instead of by reference. - Fixed: index, temporal-constraint, and exclusion-constraint selectors that read a captured variable or static member instead of the lambda parameter (
x => captured.Name) now throw at the declaration, naming the offending selector — previously they produced an unmatchable property path that failed much later with an opaque resolution error. - Fixed: provider validation no longer inspects index operations this package did not create. The satellites previously swept every
CreateIndexOperationin the migration, so a plain nativeHasIndexcarrying a provider option outside the satellite's whitelist would have failed the entiremigrations add— harmless with today's providers, but it tied your migrations to the exact index-option set each satellite knows about. - Fixed:
DbOrder.Ascnow marks a column ascending, and combining it withDbOrder.Desc(orNullsFirstwithNullsLast) throws instead of silently picking one. Repeating the same marker is still fine. - Fixed:
Npgsql:IndexSortOrder/IndexNullSortOrderare no longer forwarded onto complex indexes, and setting either now throws with a pointer toDbOrder. They duplicated whatDbOrder.Asc/Desc/NullsFirst/NullsLastalready express per column, giving one index two sources of truth for its sort options — with the annotation's half silently losing whenever the index rendered through this package's generator. - Fixed: clustered-index combinations SQL Server rejects are now caught at
migrations addrather than at apply time: a clustered index withINCLUDEcolumns, a clustered filtered index, two clustered complex indexes on one table, and — the common one — a clustered complex index on a table whose primary key already holds the clustered slot, which is the SQL Server default. - New:
UseDataCompression(DataCompressionType)on SQL Server complex indexes — the annotation was already forwarded but had no way to set it.