Skip to content
Browse files

[1.2.X] Fixed #13967 -- MySQL spatial backend now respects when `spat…

…ial_index=False`. Thanks, Simon Law, for bug report and patch.

Backport of r13443 from trunk.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 5dc5606 commit 8c87622f8b80685098b6f7cc8b823ae2118ab439 @jbronn jbronn committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/contrib/gis/db/backends/mysql/
2 django/contrib/gis/db/backends/mysql/
@@ -6,7 +6,7 @@ def sql_indexes_for_field(self, model, f, style):
from django.contrib.gis.db.models.fields import GeometryField
output = super(MySQLCreation, self).sql_indexes_for_field(model, f, style)
- if isinstance(f, GeometryField):
+ if isinstance(f, GeometryField) and f.spatial_index:
qn = self.connection.ops.quote_name
db_table = model._meta.db_table
idx_name = '%s_%s_id' % (db_table, f.column)

0 comments on commit 8c87622

Please sign in to comment.
Something went wrong with that request. Please try again.