diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-03-30 14:15:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-30 14:15:03 +0100 |
| commit | 425b26092f038accd2a5c5fc5a9bd3f82d4dd847 (patch) | |
| tree | 75405b72127b24468a11c07fd443cc1fbb364e8b | |
| parent | 0df520979a5677baf9ed2801ed5c38f859edaa4d (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.py | 6 |
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): |
