﻿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
37236	Spatial indexes cannot be added, removed, or altered on RasterField	Jacob Walls		"`RasterField` allows spatial indexes `spatial_index=True` just like `GeometryField`, but the support for adding/removing/altering spatial indexes in #35074 only checked `GeometryField` instead of `BaseSpatialField`.

For the purposes of testing only, see this diff:
{{{#!diff
diff --git a/tests/gis_tests/gis_migrations/test_operations.py b/tests/gis_tests/gis_migrations/test_operations.py
index 98201ed3f7..98f327cc2b 100644
--- a/tests/gis_tests/gis_migrations/test_operations.py
+++ b/tests/gis_tests/gis_migrations/test_operations.py
@@ -281,16 +281,16 @@ class OperationTests(OperationTestCase):
         if not self.has_spatial_indexes:
             self.skipTest(""No support for Spatial indexes"")
 
-        self.assertSpatialIndexExists(""gis_neighborhood"", ""geom"")
+        self.assertSpatialIndexExists(""gis_neighborhood"", ""rast"", raster=True)
 
         self.alter_gis_model(
             migrations.AlterField,
             ""Neighborhood"",
-            ""geom"",
+            ""rast"",
             fields.MultiPolygonField,
             field_class_kwargs={""spatial_index"": False},
         )
-        self.assertSpatialIndexNotExists(""gis_neighborhood"", ""geom"")
+        self.assertSpatialIndexNotExists(""gis_neighborhood"", ""rast"", raster=True)
 
     @skipUnlessDBFeature(""can_alter_geometry_field"")
     @skipUnless(connection.vendor == ""mysql"", ""MySQL specific test"")
}}}
{{{#!py
======================================================================
FAIL: test_alter_field_remove_spatial_index (gis_tests.gis_migrations.test_operations.OperationTests.test_alter_field_remove_spatial_index)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/Users/jwalls/django/tests/gis_tests/gis_migrations/test_operations.py"", line 293, in test_alter_field_remove_spatial_index
    self.assertSpatialIndexNotExists(""gis_neighborhood"", ""rast"", raster=True)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ""/Users/jwalls/django/tests/gis_tests/gis_migrations/test_operations.py"", line 99, in assertSpatialIndexNotExists
    self.assertFalse(
    ~~~~~~~~~~~~~~~~^
        any(
        ^^^^
    ...<3 lines>...
        )
        ^
    )
    ^
AssertionError: True is not false
}}}"	Bug	new	GIS	6.0	Normal				Accepted	0	0	0	0	0	0
