﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35074	Altering spatial_index does not actually create/drop the index	Mário Falcão	Mariusz Felisiak	"Changing `spatial_index` on existing spatial fields causes migrations to be generated as expected, but they do not actually drop/create the indexes as desired when applied.

E.g. starting with the following model
{{{
class LocationUpdate(models.Model):
    location = PointField(geography=True, spatial_index=False)
}}}

If we change `spatial_index` to `True`, a migration is generated with a single operation:
{{{
migrations.AlterField(
    model_name=""locationupdate"",
    name=""location"",
    field=django.contrib.gis.db.models.fields.PointField(
        geography=True, srid=4326
    ),
)
}}}

But applying this migration does not create the expected index and the output of `sqlmigrate` is as follows:
{{{
BEGIN;
--
-- Alter field location on locationupdate
--
-- (no-op)
COMMIT;
}}}

Detected on Django 4.2.8 with PostGIS, but also present on latest main branch across all backends."	Bug	closed	GIS	4.2	Normal	fixed			Ready for checkin	1	0	0	0	0	0
