From e14d08cd894e9d91cb5d9f44ba7532c1a223f458 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 9 Sep 2022 00:02:58 +1000 Subject: Fixed #33996 -- Fixed CheckConstraint validation on NULL values. Bug in 667105877e6723c6985399803a364848891513cc. Thanks James Beith for the report. --- docs/ref/models/constraints.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt index d0a9a017dc..8134a657d8 100644 --- a/docs/ref/models/constraints.txt +++ b/docs/ref/models/constraints.txt @@ -102,6 +102,15 @@ specifies the check you want the constraint to enforce. For example, ``CheckConstraint(check=Q(age__gte=18), name='age_gte_18')`` ensures the age field is never less than 18. +.. admonition:: Oracle + + Checks with nullable fields on Oracle must include a condition allowing for + ``NULL`` values in order for :meth:`validate() ` + to behave the same as check constraints validation. For example, if ``age`` + is a nullable field:: + + CheckConstraint(check=Q(age__gte=18) | Q(age__isnull=True), name='age_gte_18') + .. versionchanged:: 4.1 The ``violation_error_message`` argument was added. -- cgit v1.3