﻿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
37197	GIS fields with Meta.Indexes creates two indexes	David Smith		"Given this model

{{{
from django.contrib.gis.db import models

class City(models.Model):
    point = models.PointField()

    class Meta:
        indexes = [models.Index(fields=['point'], name='another_index')]
}}}

The output of `sqlmigrate` is the following - notice the two `CREATE INDEX` statements:

{{{
CREATE TABLE ""ticket_31252_city"" (""id"" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, ""point"" geometry(POINT,4326) NOT NULL);
CREATE INDEX ""ticket_31252_city_point_41eaedb4_id"" ON ""ticket_31252_city"" USING GIST (""point"");
CREATE INDEX ""another_index"" ON ""ticket_31252_city"" USING GIST (""point"");
}}}

Re-created on [https://dryorm.xterm.info/gis-double-index dryorm].

Compare this to a non-GIS model:

{{{
from django.db import models

class City(models.Model):
    point = models.CharField(max_length=100)

    class Meta:
        indexes = [models.Index(fields=['point'], name='another_index')]
}}}

Only a single index is created - see [https://dryorm.xterm.info/single_index dryorm].

Geodjango fields should only have one index created when Meta.indexes is used, mirroring the output for non-GIS models?"	Uncategorized	closed	GIS	6.0	Normal	invalid			Unreviewed	0	0	0	0	0	0
