summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-10-28 08:10:45 -0400
committerTim Graham <timograham@gmail.com>2014-10-29 08:21:24 -0400
commit03bd79ed2124d149114fa3b702878d75159ba2b8 (patch)
treee6084603b80a59f7daf1aad8558a6d8d4aa325ff /django
parentc9178ef17a0e1070f5a25096d8e13385d404dc92 (diff)
Fixed #23719 -- Fixed MySQL 5.6 crash with GeometryFields in migrations.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/db/backends/mysql/schema.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/contrib/gis/db/backends/mysql/schema.py b/django/contrib/gis/db/backends/mysql/schema.py
index 3979182c19..4d708686ba 100644
--- a/django/contrib/gis/db/backends/mysql/schema.py
+++ b/django/contrib/gis/db/backends/mysql/schema.py
@@ -15,6 +15,13 @@ class MySQLGISSchemaEditor(DatabaseSchemaEditor):
super(MySQLGISSchemaEditor, self).__init__(*args, **kwargs)
self.geometry_sql = []
+ def skip_default(self, field):
+ return (
+ super(MySQLGISSchemaEditor, self).skip_default(field) or
+ # Geometry fields are stored as BLOB/TEXT and can't have defaults.
+ isinstance(field, GeometryField)
+ )
+
def column_sql(self, model, field, include_default=False):
column_sql = super(MySQLGISSchemaEditor, self).column_sql(model, field, include_default)
# MySQL doesn't support spatial indexes on NULL columns