mirror of
https://github.com/django/django.git
synced 2025-03-30 03:00:45 +00:00
Refs #29548 -- Fixed DatabaseWrapper.display_name on MariaDB.
This commit is contained in:
parent
2ff517ccb6
commit
8d52a525c8
@ -97,7 +97,6 @@ class CursorWrapper:
|
|||||||
|
|
||||||
class DatabaseWrapper(BaseDatabaseWrapper):
|
class DatabaseWrapper(BaseDatabaseWrapper):
|
||||||
vendor = 'mysql'
|
vendor = 'mysql'
|
||||||
display_name = 'MySQL'
|
|
||||||
# This dictionary maps Field objects to their associated MySQL column
|
# This dictionary maps Field objects to their associated MySQL column
|
||||||
# types, as strings. Column-type strings can contain format strings; they'll
|
# types, as strings. Column-type strings can contain format strings; they'll
|
||||||
# be interpolated against the values of Field.__dict__ before being output.
|
# be interpolated against the values of Field.__dict__ before being output.
|
||||||
@ -329,6 +328,10 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def display_name(self):
|
||||||
|
return 'MariaDB' if self.mysql_is_mariadb else 'MySQL'
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def data_type_check_constraints(self):
|
def data_type_check_constraints(self):
|
||||||
if self.features.supports_column_check_constraints:
|
if self.features.supports_column_check_constraints:
|
||||||
|
@ -47,8 +47,8 @@ class DatabaseValidation(BaseDatabaseValidation):
|
|||||||
if field.db_index and field_type.lower() in self.connection._limited_data_types:
|
if field.db_index and field_type.lower() in self.connection._limited_data_types:
|
||||||
errors.append(
|
errors.append(
|
||||||
checks.Warning(
|
checks.Warning(
|
||||||
'MySQL does not support a database index on %s columns.'
|
'%s does not support a database index on %s columns.'
|
||||||
% field_type,
|
% (self.connection.display_name, field_type),
|
||||||
hint=(
|
hint=(
|
||||||
"An index won't be created. Silence this warning if "
|
"An index won't be created. Silence this warning if "
|
||||||
"you don't care about it."
|
"you don't care about it."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user