Kaydet (Commit) 4b1c9708 authored tarafından Adam Chainz's avatar Adam Chainz Kaydeden (comit) Tim Graham

Fixed #26966 -- Made MySQL backend skip defaults for JSON columns

Thanks mcgeeco for reporting, and claudep and timgraham for review.
üst 374b6091
......@@ -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',
}
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment