#28052 closed Bug (fixed)
Django inadvertently removes all indexes when switching to db_index=False
Description ¶
- Create a model with
data = JSONField(db_index=True)
; makemigrations; migrate - Add a
GinIndex(fields=['data'], name='foo')
to_meta.indexes
; makemigrations; migrate - Remove
db_index=True
from theJSONField
; makemigrations; migrate
After step 2 there will be a Gin index on the data
column on the model. After step 3 there's _no_ index on the data
column anymore.
Change History (6)
comment:1 by , 8 years ago
Has patch: | set |
---|---|
Needs documentation: | set |
Needs tests: | set |
comment:2 by , 8 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Note:
See TracTickets
for help on using tickets.
PR