Opened 17 years ago

Closed 12 years ago

Last modified 12 years ago

#5805 closed New feature (fixed)

Specify multicolumn indexes.

Reported by: Stavros Korokithakis <stavros@…> Owned by: Alex Gaynor
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: index multicolumn indexes database dceu2011
Cc: fnl, martin.paquette@…, diegobz, Apostolis Bessas, jeffrey@…, gert.vangool@…, mike@…, Gillingham@…, charette.s@…, Ivan Virabyan, Danilo Bargen Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It would be good if we could specify multicolumn indexes to be created in the model, sort of like unique_together but for index_together. I am not familiar with a way to do this currently, hence this feature request.

Attachments (1)

index_together.diff (7.1 KB ) - added by Jeffrey Gelens 13 years ago.
Updated patch to match trunk

Download all attachments as: .zip

Change History (26)

comment:1 by Simon G <dev@…>, 17 years ago

Resolution: duplicate
Status: newclosed

Dupe of #373, which is pending the queryset rewrite/refactor I believe..

comment:2 by matclayton, 15 years ago

Resolution: duplicate
Status: closedreopened

#373 is for multi column primary keys, not indexes.

comment:3 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

comment:4 by fnl, 15 years ago

Cc: fnl added

comment:5 by Gabriel Hurley, 14 years ago

Severity: Normal
Type: New feature

comment:6 by Martin Paquette, 14 years ago

Cc: martin.paquette@… added
Easy pickings: unset

comment:7 by diegobz, 14 years ago

Cc: diegobz added

comment:8 by Apostolis Bessas, 14 years ago

Cc: Apostolis Bessas added

comment:9 by Jeffrey Gelens, 13 years ago

Cc: jeffrey@… added

comment:10 by Jeffrey Gelens, 13 years ago

Keywords: dceu2011 added
Owner: changed from nobody to Jeffrey Gelens
Status: reopenednew
UI/UX: unset

comment:11 by Jeffrey Gelens, 13 years ago

Has patch: set

Added a patch with docs and simple test. Which I tested on MySQL, PostgreSQL and SQLite

comment:12 by Jeffrey Gelens, 13 years ago

Needs tests: set
Status: newassigned

We still need to check if the indexes are being created. For this we need better database introspection for indexes. For this #16220 will need to be fixed first. Till that moment, this ticket is on hold.

comment:13 by Gert Van Gool, 13 years ago

Cc: gert.vangool@… added

comment:14 by Mike Fogel, 13 years ago

Cc: mike@… added

by Jeffrey Gelens, 13 years ago

Attachment: index_together.diff added

Updated patch to match trunk

comment:15 by Gillingham@…, 13 years ago

Cc: Gillingham@… added

comment:16 by Simon Charette, 13 years ago

Cc: charette.s@… added

comment:17 by Aymeric Augustin, 13 years ago

#18092 was closed as a duplicate and has a patch.

comment:18 by Ivan Virabyan, 13 years ago

Cc: Ivan Virabyan added

comment:19 by Danilo Bargen, 12 years ago

Cc: Danilo Bargen added

comment:20 by mmfunkyd@…, 12 years ago

I hope it's not too late to get this into 1.5. This functionality would be extremely nice as a complement to the db_index functionality currently in Django.

comment:21 by Jeffrey Gelens, 12 years ago

The patch was working fine for trunk 10 months ago. Only tests couldn't be written because of the broken django DB introspection (see related ticket).

comment:22 by Alex Gaynor, 12 years ago

Owner: changed from Jeffrey Gelens to Alex Gaynor
Status: assignednew

comment:24 by Aymeric Augustin, 12 years ago

Resolution: fixed
Status: newclosed

comment:25 by Alex Gaynor <alex.gaynor@…>, 12 years ago

In 6f716e9e5f8f373f48b59791b80f0d68ce9e5bd2:

[1.5.x] Fixed #5805 -- it is now possible to specify multi-column indexes. Thanks to jgelens for the original patch. Backport of 4285571c5a9bf6ca3cb7c4d774942b9ae5b537e4.

Note: See TracTickets for help on using tickets.
Back to Top