Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 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:

Description

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)

Attachments (0)

Change History (7)

comment:1 Changed 6 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 :
http://code.djangoproject.com/ticket/7170

comment:2 Changed 6 years ago by gav

  • Keywords qsrf-cleanup added

comment:3 Changed 6 years ago by DavidReynolds

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

comment:4 Changed 6 years ago by jacob

  • milestone set to 1.0

comment:5 Changed 6 years ago by Simon Greenhill

  • Triage Stage changed from Unreviewed to Accepted

comment:6 Changed 6 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 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.