diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-03-15 12:34:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-15 12:34:54 +0100 |
| commit | 36a000858b5eee13b039aaad490c33b037a1dc05 (patch) | |
| tree | 4fc4f46a2bb81f9534771f7324ecc24cc6085bdf | |
| parent | cbf1e87398a58737e27e1b680283903caf661f90 (diff) | |
Refs #33996 -- Updated CheckConstraint validation on NULL values on Oracle 23c+.
Oracle 23c supports comparing boolean expressions.
| -rw-r--r-- | django/db/backends/oracle/features.py | 5 | ||||
| -rw-r--r-- | docs/ref/models/constraints.txt | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/django/db/backends/oracle/features.py b/django/db/backends/oracle/features.py index 4d7ca7dd1f..a48bc627f7 100644 --- a/django/db/backends/oracle/features.py +++ b/django/db/backends/oracle/features.py @@ -78,7 +78,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_slicing_ordering_in_compound = True requires_compound_order_by_subquery = True allows_multiple_constraints_on_same_fields = False - supports_comparing_boolean_expr = False supports_json_field_contains = False supports_collation_on_textfield = False test_now_utc_template = "CURRENT_TIMESTAMP AT TIME ZONE 'UTC'" @@ -175,6 +174,10 @@ class DatabaseFeatures(BaseDatabaseFeatures): return self.connection.oracle_version >= (23,) @cached_property + def supports_comparing_boolean_expr(self): + return self.connection.oracle_version >= (23,) + + @cached_property def supports_aggregation_over_interval_types(self): return self.connection.oracle_version >= (23,) diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt index fa6edfd766..fd24eeee3a 100644 --- a/docs/ref/models/constraints.txt +++ b/docs/ref/models/constraints.txt @@ -131,10 +131,10 @@ ensures the age field is never less than 18. name="age_gte_18_and_others", ) -.. admonition:: Oracle +.. admonition:: Oracle < 23c - Checks with nullable fields on Oracle must include a condition allowing for - ``NULL`` values in order for :meth:`validate() <BaseConstraint.validate>` + Checks with nullable fields on Oracle < 23c must include a condition + allowing for ``NULL`` values in order for :meth:`~BaseConstraint.validate` to behave the same as check constraints validation. For example, if ``age`` is a nullable field:: |
