diff options
author | Adam Chainz <me@adamj.eu> | 2016-08-01 18:51:25 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2016-08-01 13:51:25 -0400 |
commit | 4b1c9708d629c08ebbd73293c89a159ccb436d4d (patch) | |
tree | 25114e273fe57fe622a5b93c25ca4bb722bf30b2 /django/db/backends/mysql/schema.py | |
parent | 374b6091ac5ca96d05945413f3a362cc29ec9511 (diff) | |
download | django-4b1c9708d629c08ebbd73293c89a159ccb436d4d.tar.gz |
Fixed #26966 -- Made MySQL backend skip defaults for JSON columns
Thanks mcgeeco for reporting, and claudep and timgraham for review.
Diffstat (limited to 'django/db/backends/mysql/schema.py')
-rw-r--r-- | django/db/backends/mysql/schema.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/backends/mysql/schema.py b/django/db/backends/mysql/schema.py index 4aa40f7cb5..4a61807234 100644 --- a/django/db/backends/mysql/schema.py +++ b/django/db/backends/mysql/schema.py @@ -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', } ) |