Fixed #23719 -- Fixed MySQL 5.6 crash with GeometryFields in migrations.

This commit is contained in:
Tim Graham 2014-10-28 08:10:45 -04:00
parent c9178ef17a
commit 03bd79ed21
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -24,3 +24,6 @@ Bugfixes
* Fixed a :djadmin:`makemessages` regression in 1.7.1 when
:setting:`STATIC_ROOT` has the default ``None`` value (:ticket:`23717`).
* Fixed MySQL 5.6+ crash with ``GeometryField``\s in migrations
(:ticket:`23719`).