1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Refs #11964 -- Made constraint support check respect required_db_features.

This will notably silence the warnings issued when running the test
suite on MySQL.
This commit is contained in:
Simon Charette
2019-08-10 02:41:18 -04:00
committed by Mariusz Felisiak
parent 2fb872e56f
commit 8b3e1b6e9e
6 changed files with 67 additions and 26 deletions

View File

@@ -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(