Skip to content

v5.0.2

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 15 Aug 13:20
· 71 commits to main since this release

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 DesignTimeServicesReferenceAttribute is 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 OVERLAPS constraints and temporal foreign keys are now rendered at design time, like exclusion constraints, and no longer need UseNpgsqlComplexIndexes(). Previously a consumer without that wiring got a plain UNIQUE (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 EXCLUDE constraints 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: CompositeIndexDefinition equality 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 CreateIndexOperation in the migration, so a plain native HasIndex carrying a provider option outside the satellite's whitelist would have failed the entire migrations add — harmless with today's providers, but it tied your migrations to the exact index-option set each satellite knows about.
  • Fixed: DbOrder.Asc now marks a column ascending, and combining it with DbOrder.Desc (or NullsFirst with NullsLast) throws instead of silently picking one. Repeating the same marker is still fine.
  • Fixed: Npgsql:IndexSortOrder/IndexNullSortOrder are no longer forwarded onto complex indexes, and setting either now throws with a pointer to DbOrder. They duplicated what DbOrder.Asc/Desc/NullsFirst/NullsLast already 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 add rather than at apply time: a clustered index with INCLUDE columns, 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.