[Django] #27738: Default index name not set outside of migrations

22 views
Skip to first unread message

Django

unread,
Jan 16, 2017, 1:48:05 PM1/16/17
to django-...@googlegroups.com
#27738: Default index name not set outside of migrations
-----------------------------------------+----------------------------
Reporter: Mads Jensen | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords: db-indexes
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+----------------------------
If an index is added outside of the migration-system, then the name will
default to the empty string. This can be reproduced in the test suite by
removing the name-argument to the constructor of either `BrinIndex` or
`GinIndex`.

`django/models/base.py` calls `set_set_name_with_model`. Perhaps this call
could be moved to `Index` instead?

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

Django

unread,
Jan 16, 2017, 1:51:10 PM1/16/17
to django-...@googlegroups.com
#27738: Default index name not set outside of migrations
-------------------------------+--------------------------------------

Reporter: Mads Jensen | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Resolution:

Keywords: db-indexes | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Tim Graham):

What's the use case for adding indexes without using migrations and how is
it done? I'm not sure if this should be supported.

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

Django

unread,
Jan 17, 2017, 9:51:20 AM1/17/17
to django-...@googlegroups.com
#27738: Default index name not set outside of migrations
-------------------------------+--------------------------------------

Reporter: Mads Jensen | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Resolution:

Keywords: db-indexes | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Mads Jensen):

I suppose it may be an obscure case, so maybe closing this as "works for
me" or "some day/maybe" would be fine.

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

Django

unread,
Jan 17, 2017, 1:26:46 PM1/17/17
to django-...@googlegroups.com
#27738: Default index name not set outside of migrations
-------------------------------------+-------------------------------------

Reporter: Mads Jensen | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: wontfix

Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => wontfix
* component: Uncategorized => Database layer (models, ORM)


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

Django

unread,
Jan 17, 2017, 1:32:02 PM1/17/17
to django-...@googlegroups.com
#27738: Default index name not set outside of migrations
-------------------------------------+-------------------------------------

Reporter: Mads Jensen | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Markus Holtermann):

`name` is supposed to be a required argument when you define an index in
`_meta.indexes`. However, for backwards compatibility reasons with auto-
generated index names for e.g. `db_index=True` and `index_together` the
name cannot be set during object creation but needs to be patched in later
while running migrations.

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

Reply all
Reply to author
Forward
0 new messages