Opened 8 years ago

Closed 8 years ago

#27165 closed Cleanup/optimization (fixed)

CreateModel without indexes always includes options={'indexes': []}

Reported by: Tim Graham Owned by: Akshesh Doshi
Component: Migrations Version: dev
Severity: Normal Keywords: 1.11
Cc: Akshesh Doshi Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you create a model without any indexes, the CreateModel operation always includes:

options={
    'indexes': [],
},

It would be nice to avoid that, if possible.

Change History (6)

comment:1 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Akshesh Doshi, 8 years ago

A related comment (and the place where not having this default would cause problems) - https://github.com/django/django/pull/6726#discussion-diff-66307466

comment:3 by Claude Paroz, 8 years ago

For me, having indexes=[] in ModelState or in migration files is not necessary the same thing. I didn't explore further, though.

comment:4 by Akshesh Doshi, 8 years ago

Owner: changed from nobody to Akshesh Doshi
Status: newassigned

Ahh, I see. I should be able to remove it from the migrations file.

comment:6 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 358c6f21:

Fixed #27165 -- Removed unnecessary CreateModel(... 'indexes': []) in migrations.

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