summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2019-08-10 02:41:18 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-08-12 06:44:37 +0200
commit8b3e1b6e9e4ee87fe85b2e5437faf59457e03e62 (patch)
treef2b55bc4805add78a494942135bf75c999033f39 /django
parent2fb872e56f064361c2cd4674c0f23cd419994d82 (diff)
Refs #11964 -- Made constraint support check respect required_db_features.
This will notably silence the warnings issued when running the test suite on MySQL.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 18ee0b4911..91b4639524 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -1813,7 +1813,10 @@ class Model(metaclass=ModelBase):
if not router.allow_migrate_model(db, cls):
continue
connection = connections[db]
- if connection.features.supports_table_check_constraints:
+ if (
+ connection.features.supports_table_check_constraints or
+ 'supports_table_check_constraints' in cls._meta.required_db_features
+ ):
continue
if any(isinstance(constraint, CheckConstraint) for constraint in cls._meta.constraints):
errors.append(