Opened 6 years ago
Closed 6 years ago
#30847 closed Bug (worksforme)
Geodjango not respecting spatial_index=False.
| Reported by: | Thomas Steen Rasmussen | Owned by: | nobody |
|---|---|---|---|
| Component: | GIS | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Hello,
I believe the logic in https://github.com/django/django/blob/master/django/contrib/gis/db/backends/postgis/schema.py#L17-L18 is inverted. The index is always created regardless of the setting of spatial_index=False. This should be easy to fix, just return False instead of True in L18 :)
Change History (2)
comment:1 by , 6 years ago
| Summary: | PostGIS not respecting spatial_index=False → Geodjango not respecting spatial_index=False |
|---|
comment:2 by , 6 years ago
| Easy pickings: | unset |
|---|---|
| Resolution: | → worksforme |
| Status: | new → closed |
| Summary: | Geodjango not respecting spatial_index=False → Geodjango not respecting spatial_index=False. |
| Version: | 2.2 → master |
Note:
See TracTickets
for help on using tickets.
I don't see any issue in this code,
PostGISSchemaEditoe._field_should_be_indexed()callssuper()_field_should_be_indexed()iffielddoesn't have aspatial_indexattribute or if it is set toFalse.