|
@@ -27,8 +27,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|
|
allows_auto_pk_0 = False
|
|
|
can_release_savepoints = True
|
|
|
atomic_transactions = False
|
|
|
- supports_column_check_constraints = False
|
|
|
- supports_table_check_constraints = False
|
|
|
can_clone_databases = True
|
|
|
supports_temporal_subtraction = True
|
|
|
supports_select_intersection = False
|
|
@@ -89,6 +87,20 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|
|
return self.connection.mysql_version >= (10, 2)
|
|
|
return self.connection.mysql_version >= (8, 0, 2)
|
|
|
|
|
|
+ @cached_property
|
|
|
+ def supports_column_check_constraints(self):
|
|
|
+ return self.connection.mysql_is_mariadb and self.connection.mysql_version >= (10, 2, 1)
|
|
|
+
|
|
|
+ supports_table_check_constraints = property(operator.attrgetter('supports_column_check_constraints'))
|
|
|
+
|
|
|
+ @cached_property
|
|
|
+ def can_introspect_check_constraints(self):
|
|
|
+ if self.connection.mysql_is_mariadb:
|
|
|
+ version = self.connection.mysql_version
|
|
|
+ if (version >= (10, 2, 22) and version < (10, 3)) or version >= (10, 3, 10):
|
|
|
+ return True
|
|
|
+ return False
|
|
|
+
|
|
|
@cached_property
|
|
|
def has_select_for_update_skip_locked(self):
|
|
|
return not self.connection.mysql_is_mariadb and self.connection.mysql_version >= (8, 0, 1)
|