summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2024-03-30 14:15:03 +0100
committerGitHub <noreply@github.com>2024-03-30 14:15:03 +0100
commit425b26092f038accd2a5c5fc5a9bd3f82d4dd847 (patch)
tree75405b72127b24468a11c07fd443cc1fbb364e8b
parent0df520979a5677baf9ed2801ed5c38f859edaa4d (diff)
Refs #35234 -- Skipped CheckConstraint system checks if not supported.
Thanks Tim Graham for the report. Regression in 0fb104dda287431f5ab74532e45e8471e22b58c8.
-rw-r--r--django/db/models/constraints.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/models/constraints.py b/django/db/models/constraints.py
index e01a68e67b..9c63a0940d 100644
--- a/django/db/models/constraints.py
+++ b/django/db/models/constraints.py
@@ -200,7 +200,11 @@ class CheckConstraint(BaseConstraint):
id="models.W027",
)
)
- else:
+ elif (
+ connection.features.supports_table_check_constraints
+ or "supports_table_check_constraints"
+ not in model._meta.required_db_features
+ ):
references = set()
condition = self.condition
if isinstance(condition, Q):