From aaa5dfbf53e20c2dd24268502455e82211250172 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Wed, 21 Jul 2010 15:23:18 +0000 Subject: [PATCH] Fixed #13967 -- MySQL spatial backend now respects when `spatial_index=False`. Thanks, Simon Law, for bug report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13443 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/db/backends/mysql/creation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/gis/db/backends/mysql/creation.py b/django/contrib/gis/db/backends/mysql/creation.py index 93fd2e6166c..dda77ea6abd 100644 --- a/django/contrib/gis/db/backends/mysql/creation.py +++ b/django/contrib/gis/db/backends/mysql/creation.py @@ -6,7 +6,7 @@ class MySQLCreation(DatabaseCreation): 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)