Opened 8 years ago

Closed 7 years ago

Last modified 4 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: UI/UX:


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 8 years ago by Sephi

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 7 years ago by gav

  • Keywords qsrf-cleanup added

comment:3 Changed 7 years ago by DavidReynolds

  • Component changed from django.core.mail to Database wrapper

comment:4 Changed 7 years ago by jacob

  • milestone set to 1.0

comment:5 Changed 7 years ago by Simon Greenhill

  • Triage Stage changed from Unreviewed to Accepted

comment:6 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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