summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/constraints.py
AgeCommit message (Collapse)Author
2026-01-10Fixed #36827 -- Added support for exclusion constraints using Hash indexes ↵Haki Benita
on PostgreSQL.
2026-01-08Fixed #36852 -- Ignored index_type case in ExclusionConstraint equality check.Haki Benita
2025-06-18Fixed #32770 -- Added system check to ensure django.contrib.postgres is ↵Clifford Gama
installed when using its features. Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS when using: * PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField), * PostgreSQL indexes (PostgresIndex and all subclasses), and * ExclusionConstraint The check provides immediate feedback during system checks rather than failing later with obscure runtime and database errors. Thanks to Simon Charette and Sarah Boyce for reviews.
2025-03-10Fixed #36222 -- Fixed ExclusionConstraint validation crash on excluded ↵saJaeHyukc
fields in condition. Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
2025-02-19Fixed #35358, Refs #35234 -- Renamed _check() methods to check() for ↵Mariusz Felisiak
constraints.
2024-09-09Refs #373 -- Added Model._is_pk_set() abstraction to check if a Model's PK ↵Csirmaz Bendegúz
is set.
2024-08-12Fixed #35575 -- Added support for constraint validation on GeneratedFields.Mark Gensler
2024-08-05Refs #35638 -- Avoided wrapping expressions with Value in ↵David Sanders
_get_field_value_map() and renamed to _get_field_expression_map().
2024-05-27Fixed #35479 -- Dropped support for PostgreSQL 13 and PostGIS 3.0.Mariusz Felisiak
2024-05-14Fixed #35275 -- Fixed Meta.constraints validation crash on UniqueConstraint ↵Mariusz Felisiak
with OpClass(). This also introduces Expression.constraint_validation_compatible that allows specifying that expression should be ignored during a constraint validation.
2024-02-29Fixed #35234 -- Added system checks for invalid model field names in ↵Simon Charette
ExclusionConstraint.expressions.
2023-02-23Fixed #34338 -- Allowed customizing code of ValidationError in ↵Xavier Fernandez
BaseConstraint and subclasses.
2023-02-23Refs #33829 -- Added violation_error_message to constraints' __repr__().Xavier Fernandez
2023-01-18Refs #34233 -- Used types.NoneType.Nick Pope
Available since Python 3.10 where it was reintroduced.
2023-01-17Refs #33342 -- Removed ExclusionConstraint.opclasses per deprecation timeline.Mariusz Felisiak
2022-11-10Fixed #34149 -- Allowed adding deferrable conditional exclusion constraints ↵Márton Salomváry
on PostgreSQL.
2022-08-11Replaced Expression.replace_references() with .replace_expressions().Simon Charette
The latter allows for more generic use cases beyond the currently limited ones constraints validation has. Refs #28333, #30581.
2022-08-11Optimized ExclusionConstraint.validate() a bit.Mariusz Felisiak
References to excluded fields are omitted in the replacement_map, so there is no need to replace references before checking for exclusions.
2022-08-11Used F.replace_references().Mariusz Felisiak
Follow up to 63884829acd207404f2a5c3cc1d6b4cd0a822b70.
2022-07-08Fixed #33829 -- Made BaseConstraint.deconstruct() and equality handle ↵Stéphane "Twidi" Angel
violation_error_message. Regression in 667105877e6723c6985399803a364848891513cc.
2022-05-19Fixed #33717 -- Dropped support for PostgreSQL 11.Mariusz Felisiak
2022-05-10Fixed #30581 -- Added support for Meta.constraints validation.Gagaro
Thanks Simon Charette, Keryn Knight, and Mariusz Felisiak for reviews.
2022-03-16Made BaseConstraint importable from django.db.models.Gagaro
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-12-27Refs #33342 -- Deprecated ExclusionConstraint.opclasses.Hannes Ljungberg
2021-12-24Fixed #33342 -- Added support for using OpClass() in exclusion constraints.Hannes Ljungberg
2021-10-01Refs #32943 -- Added support for covering exclusion constraints using ↵Nick Pope
SP-GiST indexes on PostgreSQL 14+.
2021-10-01Fixed typo in exception message for GiST indexes and exclusion constraints.Nick Pope
2021-06-22Fixed #32858 -- Fixed ExclusionConstraint crash with index transforms in ↵Lucidiot
expressions.
2021-04-07Refs #32074 -- Made ExclusionConstraint.__repr__() use Deferrable.__repr__().Mariusz Felisiak
Follow up to c6859f1a684edec7bb33038b4408046a4db0c16d.
2021-02-19Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more ↵Hannes Ljungberg
consistent.
2020-10-14Refs #32096 -- Fixed ExclusionConstraint crash with JSONField key transforms ↵Mariusz Felisiak
in expressions. Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd.
2020-08-19Fixed #31902 -- Fixed crash of ExclusionConstraint on expressions with params.Maxim Petrov
2020-06-16Fixed #31709 -- Added support for opclasses in ExclusionConstraint.Hannes Ljungberg
2020-06-12Fixed #31649 -- Added support for covering exclusion constraints on ↵Hannes Ljungberg
PostgreSQL 12+.
2020-05-01Fixed #31455 -- Added support for deferrable exclusion constraints on ↵Ian Foote
PostgreSQL.
2019-11-21Refs #11964 -- Removed SimpleCol in favor of Query(alias_cols).Simon Charette
This prevent having to pass simple_col through multiple function calls by defining whether or not references should be resolved with aliases at the Query level.
2019-10-01Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU
implemented comparisons. Changed __eq__ to return NotImplemented instead of False if compared to an object of the same type, as is recommended by the Python data model reference. Now these models can be compared to ANY (or other objects with __eq__ overwritten) without returning False automatically.
2019-07-16Fixed #29824 -- Added support for database exclusion constraints on PostgreSQL.Mads Jensen
Thanks to Nick Pope and Mariusz Felisiak for review. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>