Refs #35074 -- Added PostGISSchemaEditor._create_spatial_index_name().

This is consistent with Oracle and MySQL GIS database backends.
This commit is contained in:
Mário Falcão 2024-08-18 07:19:52 +02:00 committed by Sarah Boyce
parent 5865ff5adc
commit d4bce26c94
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class PostGISSchemaEditor(DatabaseSchemaEditor):
opclasses = [self.geom_index_ops_nd]
name = kwargs.get("name")
if not name:
name = self._create_index_name(model._meta.db_table, [field.column], "_id")
name = self._create_spatial_index_name(model, field)
return super()._create_index_sql(
model,
@ -79,3 +79,6 @@ class PostGISSchemaEditor(DatabaseSchemaEditor):
),
[],
)
def _create_spatial_index_name(self, model, field):
return self._create_index_name(model._meta.db_table, [field.column], "_id")