[Django] #28052: Django inadvertently removes all indexes when switching to db_index=False

34 views
Skip to first unread message

Django

unread,
Apr 7, 2017, 9:53:49 AM4/7/17
to django-...@googlegroups.com
#28052: Django inadvertently removes all indexes when switching to db_index=False
---------------------------------------------+------------------------
Reporter: Markus Holtermann | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
Severity: Release blocker | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
1. Create a model with `data = JSONField(db_index=True)`; makemigrations;
migrate
1. Add a `GinIndex(fields=['data'], name='foo')` to `_meta.indexes`;
makemigrations; migrate
1. Remove `db_index=True` from the `JSONField`; 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/28052>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 7, 2017, 9:56:07 AM4/7/17
to django-...@googlegroups.com
#28052: Django inadvertently removes all indexes when switching to db_index=False
-----------------------------------+------------------------------------

Reporter: Markus Holtermann | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Markus Holtermann):

* needs_docs: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1


Comment:

[https://github.com/django/django/pull/8329 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28052#comment:1>

Django

unread,
Apr 26, 2017, 4:56:57 AM4/26/17
to django-...@googlegroups.com
#28052: Django inadvertently removes all indexes when switching to db_index=False
-----------------------------------+------------------------------------

Reporter: Markus Holtermann | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Markus Holtermann):

* needs_docs: 1 => 0
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28052#comment:2>

Django

unread,
May 1, 2017, 12:21:26 PM5/1/17
to django-...@googlegroups.com
#28052: Django inadvertently removes all indexes when switching to db_index=False
-----------------------------------+------------------------------------

Reporter: Markus Holtermann | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.11
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"663e48947ff8ef3e6a6275bda2d1ee1b0de13be3" 663e4894]:
{{{
#!CommitTicketReference repository=""
revision="663e48947ff8ef3e6a6275bda2d1ee1b0de13be3"
Fixed #28052 -- Prevented dropping Meta.indexes when changing db_index to
False.

Thanks Marc Tamlyn for the report and Ian Foote/Tim Graham for review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28052#comment:3>

Django

unread,
May 1, 2017, 12:28:47 PM5/1/17
to django-...@googlegroups.com
#28052: Django inadvertently removes all indexes when switching to db_index=False
-----------------------------------+------------------------------------

Reporter: Markus Holtermann | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.11
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"6afede82192067efecedb039c29eb301816d5fb5" 6afede8]:
{{{
#!CommitTicketReference repository=""
revision="6afede82192067efecedb039c29eb301816d5fb5"
[1.11.x] Fixed #28052 -- Prevented dropping Meta.indexes when changing
db_index to False.

Thanks Marc Tamlyn for the report and Ian Foote/Tim Graham for review.

Backport of 663e48947ff8ef3e6a6275bda2d1ee1b0de13be3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28052#comment:4>

Django

unread,
May 1, 2017, 10:23:00 PM5/1/17
to django-...@googlegroups.com
#28052: Django inadvertently removes all indexes when switching to db_index=False
-----------------------------------+------------------------------------

Reporter: Markus Holtermann | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.11
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d0e43f225f59145903c72c650eeef1f80e12f9ed" d0e43f2]:
{{{
#!CommitTicketReference repository=""
revision="d0e43f225f59145903c72c650eeef1f80e12f9ed"
Refs #28052 -- Cleaned up some indexes in schema tests.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28052#comment:5>

Django

unread,
May 1, 2017, 10:23:27 PM5/1/17
to django-...@googlegroups.com
#28052: Django inadvertently removes all indexes when switching to db_index=False
-----------------------------------+------------------------------------

Reporter: Markus Holtermann | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.11
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"4c12b10263e3ff92872d33928f6d1dd820de8c0a" 4c12b102]:
{{{
#!CommitTicketReference repository=""
revision="4c12b10263e3ff92872d33928f6d1dd820de8c0a"
[1.11.x] Refs #28052 -- Cleaned up some indexes in schema tests.

Backport of d0e43f225f59145903c72c650eeef1f80e12f9ed from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28052#comment:6>

Reply all
Reply to author
Forward
0 new messages