[Django] #26709: Add operation for creating database indexes and class based indexes

14 views
Skip to first unread message

Django

unread,
Jun 5, 2016, 3:10:02 AM6/5/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Keywords: db-indexes
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------
With all the discussion starting from Marc's
[https://github.com/django/deps/pull/6/ DEP] and continuing at various
[https://github.com/django/deps/pull/19/ other]
[https://groups.google.com/forum/#!searchin/django-developers/akki/django-
developers/lASYirbQvQA/6x-QbHHnCQAJ places], the first step we can take
towards having class based indexes is to create the base `Index` class and
an operation (`CreateIndex`) to create them. This would allow us to create
indexes from the migrations using a defined API of the `Index` class
without even touching the model layer.
A `DropIndex` will also be required to be created.

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

Django

unread,
Jun 5, 2016, 3:33:02 PM6/5/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------

Reporter: akki | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


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

Django

unread,
Jun 6, 2016, 1:45:11 AM6/6/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------

Reporter: akki | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

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

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


Comment:

A working model - https://github.com/django/django/pull/6726/

Misses docs for the new `Index` class.

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

Django

unread,
Jun 8, 2016, 10:32:32 AM6/8/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------

Reporter: akki | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* needs_docs: 1 => 0


Comment:

Added docs for the new index classes.

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

Django

unread,
Jun 27, 2016, 10:41:26 AM6/27/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: fixed

Keywords: db-indexes | 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:"156e2d59cf92eb252c2f6ef9bb0b65f26c707de2" 156e2d59]:
{{{
#!CommitTicketReference repository=""
revision="156e2d59cf92eb252c2f6ef9bb0b65f26c707de2"
Fixed #26709 -- Added class-based indexes.

Added the AddIndex and RemoveIndex operations to use them in migrations.

Thanks markush, mjtamlyn, timgraham, and charettes for review and advice.
}}}

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

Django

unread,
Jul 7, 2016, 7:31:43 AM7/7/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"b1e7d19d4c7015efe0c65361bb7f00a2f1c7047c" b1e7d19d]:
{{{
#!CommitTicketReference repository=""
revision="b1e7d19d4c7015efe0c65361bb7f00a2f1c7047c"
Refs #26709 -- Required a name for Indexes passed to AddIndex.

Thanks to Markush for discussions.
}}}

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

Django

unread,
Jul 7, 2016, 7:36:46 AM7/7/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"f7e907115fef94e890a0a5b706ebdfb60eb363d4" f7e9071]:
{{{
#!CommitTicketReference repository=""
revision="f7e907115fef94e890a0a5b706ebdfb60eb363d4"
Refs #26709 -- Added IndexOperation to avoid code duplication.
}}}

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

Django

unread,
Jul 7, 2016, 10:07:16 AM7/7/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"52442898e747e9d76bf6349938fa3dada6f0e887" 52442898]:
{{{
#!CommitTicketReference repository=""
revision="52442898e747e9d76bf6349938fa3dada6f0e887"
Refs #26709 -- Added 'model' argument to SchemaEditor.add/remove_index()

This removes the dependency of the Index class on its model attribute
when a name is passed to it.

Thanks to Markush for discussions.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:7>

Django

unread,
Jul 7, 2016, 10:23:44 AM7/7/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"3551fb537f403930763c01c85905baf3ad9b7fd8" 3551fb53]:
{{{
#!CommitTicketReference repository=""
revision="3551fb537f403930763c01c85905baf3ad9b7fd8"
Refs #26709 -- Documented SchemaEditor.add/remove_index().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:8>

Django

unread,
Jul 7, 2016, 10:38:05 AM7/7/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"fc3ac6573524acc58c23ae2c721c61bc9ed8c8d5" fc3ac65]:
{{{
#!CommitTicketReference repository=""
revision="fc3ac6573524acc58c23ae2c721c61bc9ed8c8d5"
Refs #26709 -- Checked allow_migrate_model() in Add/RemoveIndex
operations.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:9>

Django

unread,
Aug 2, 2016, 2:36:04 PM8/2/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"b92c6b7d5641e927145318adaaca1156ce26ddd2" b92c6b7]:
{{{
#!CommitTicketReference repository=""
revision="b92c6b7d5641e927145318adaaca1156ce26ddd2"
Refs #26709 -- Replaced Index.get_name() with set_name_with_model().

This removes the dependency of the Index class on its 'model'
attribute.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:10>

Django

unread,
Aug 16, 2016, 9:16:05 AM8/16/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"a71724cd04e6b2b0c97f1cdbea2e528e65373be3" a71724cd]:
{{{
#!CommitTicketReference repository=""
revision="a71724cd04e6b2b0c97f1cdbea2e528e65373be3"
Refs #26709 -- Added index name to AddIndex.describe().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:11>

Django

unread,
Aug 16, 2016, 9:57:46 AM8/16/16
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-----------------------------+------------------------------------
Reporter: akki | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | 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:"c969b17ad83e8efdd7f887b61ad75370395434ca" c969b17]:
{{{
#!CommitTicketReference repository=""
revision="c969b17ad83e8efdd7f887b61ad75370395434ca"
Refs #26709 -- Added type check for models.Index fields argument.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:12>

Django

unread,
Mar 14, 2017, 10:53:54 AM3/14/17
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-------------------------------+------------------------------------
Reporter: Akshesh Doshi | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Markus Holtermann <info@…>):

In [changeset:"e7033e00f8e1ba2ffe538e56c5088a7e94c2e45d" e7033e0]:
{{{
#!CommitTicketReference repository=""
revision="e7033e00f8e1ba2ffe538e56c5088a7e94c2e45d"
Used constant instead of hard-coded value for max index name length

Refs #26709
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:13>

Django

unread,
Mar 14, 2017, 10:55:50 AM3/14/17
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-------------------------------+------------------------------------
Reporter: Akshesh Doshi | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Markus Holtermann <info@…>):

In [changeset:"c654ead8988d05349e34b63e40dc1e42f9f2c2b9" c654ead8]:
{{{
#!CommitTicketReference repository=""
revision="c654ead8988d05349e34b63e40dc1e42f9f2c2b9"
[1.11.x] Used constant instead of hard-coded value for max index name
length

Refs #26709

Backport of e7033e00f8e1ba2ffe538e56c5088a7e94c2e45d from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:14>

Django

unread,
Jan 12, 2021, 3:08:36 PM1/12/21
to django-...@googlegroups.com
#26709: Add operation for creating database indexes and class based indexes
-------------------------------+------------------------------------
Reporter: Akshesh Doshi | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: master

Severity: Normal | Resolution: fixed
Keywords: db-indexes | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"4c62cdaa1041d49d0b46f6cef5f4618f020fff29" 4c62cdaa]:
{{{
#!CommitTicketReference repository=""
revision="4c62cdaa1041d49d0b46f6cef5f4618f020fff29"
Refs #26709 -- Made Index raise ValueError on non-string fields.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26709#comment:15>

Reply all
Reply to author
Forward
0 new messages