mirror of https://github.com/django/django.git
Fixed #26966 -- Made MySQL backend skip defaults for JSON columns
Thanks mcgeeco for reporting, and claudep and timgraham for review.
This commit is contained in:
parent
374b6091ac
commit
4b1c9708d6
|
@ -27,8 +27,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
|||
|
||||
def skip_default(self, field):
|
||||
"""
|
||||
MySQL doesn't accept default values for TEXT and BLOB types, and
|
||||
implicitly treats these columns as nullable.
|
||||
MySQL doesn't accept default values for some data types and implicitly
|
||||
treats these columns as nullable.
|
||||
"""
|
||||
db_type = field.db_type(self.connection)
|
||||
return (
|
||||
|
@ -36,6 +36,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
|||
db_type.lower() in {
|
||||
'tinyblob', 'blob', 'mediumblob', 'longblob',
|
||||
'tinytext', 'text', 'mediumtext', 'longtext',
|
||||
'json',
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue