What's New in Version 4.0.0
This release introduces comprehensive support for PostgreSQL 18 Temporal Constraints, allowing you to enforce temporal referential integrity directly at the database level while keeping your EF Core models clean.
-
Temporal UNIQUE Constraints (WITHOUT OVERLAPS)
- Added the
HasTemporalConstraint()builder method to define standalone temporal unique constraints over scalar keys and a period (range) column. - Automatically handles the injection of the required
btree_gistextension during migrations.
- Added the
-
Temporal FOREIGN KEY Constraints (PERIOD)
- Added the
HasTemporalForeignKey()builder method to enforce temporal referential integrity between dependent and principal entities. - Ensures that a dependent's period is fully covered by matching principal periods.
- Supports composite keys and includes built-in validation to ensure matching key counts and correct range type usage.
- Added the
Both features generate proper standalone DDL constraints during EF Core migrations (requires UseNpgsqlComplexIndexes()), bypassing EF's limitation on using non-comparable range types in primary keys.
Full Changelog: v3.1.5...v4.0.0