Refs #29548 -- Fixed DatabaseWrapper.display_name on MariaDB.

This commit is contained in:
Mariusz Felisiak 2019-07-23 13:34:06 +02:00 committed by GitHub
parent 2ff517ccb6
commit 8d52a525c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -97,7 +97,6 @@ class CursorWrapper:
class DatabaseWrapper(BaseDatabaseWrapper):
vendor = 'mysql'
display_name = 'MySQL'
# This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict__ before being output.
@ -329,6 +328,10 @@ class DatabaseWrapper(BaseDatabaseWrapper):
else:
return True
@cached_property
def display_name(self):
return 'MariaDB' if self.mysql_is_mariadb else 'MySQL'
@cached_property
def data_type_check_constraints(self):
if self.features.supports_column_check_constraints:

View File

@ -47,8 +47,8 @@ class DatabaseValidation(BaseDatabaseValidation):
if field.db_index and field_type.lower() in self.connection._limited_data_types:
errors.append(
checks.Warning(
'MySQL does not support a database index on %s columns.'
% field_type,
'%s does not support a database index on %s columns.'
% (self.connection.display_name, field_type),
hint=(
"An index won't be created. Silence this warning if "
"you don't care about it."