Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#7186 closed (fixed)

Django creates redundant unique index for OneToOneField on MySQL

Reported by: Peter Melvyn Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords: qsrf-cleanup MySQL redundant unique index
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I've noticed, that Django r7411 still generates reduntandt unique indeces when Unique=True, db_index=True and reopened ticked #3030.

Then I updated to r7519 (current head) and discovered, that reduntant unique index is create for OneToOneField (MySQL creates inherent foreign key on UNIQUE column declaration)

Change History (7)

comment:1 Changed 12 years ago by Sephi

I've already filled a bug report for the OneToOneField problem here :

comment:2 Changed 12 years ago by George Vilches

Keywords: qsrf-cleanup added

comment:3 Changed 12 years ago by David Reynolds

Component: django.core.mailDatabase wrapper

comment:4 Changed 12 years ago by Jacob

milestone: 1.0

comment:5 Changed 12 years ago by Simon Greenhill

Triage Stage: UnreviewedAccepted

comment:6 Changed 12 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [7790]) Make sure we only create the minimum number of table indexes for MySQL.

This patch simplifies a bunch of code for all backends and removes some
duplicate index creation for MySQL, in particular (versions 4.x and later).
Patch from Nis Jørgensen.

Fixed #5671, #5680, #7170, #7186.

comment:5 Changed 8 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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