Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22903 closed Bug (fixed)

Cannot generate a migration if index_together or unique_together is removed from a model

Reported by: Tim Graham Owned by: Tim Graham
Component: Migrations Version: 1.7-beta-2
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Traceback (most recent call last):
...
  File "/home/tim/code/django/django/db/migrations/autodetector.py", line 50, in changes
    changes = self._detect_changes(convert_apps)
  File "/home/tim/code/django/django/db/migrations/autodetector.py", line 178, in _detect_changes
    self.generate_altered_index_together()
  File "/home/tim/code/django/django/db/migrations/autodetector.py", line 788, in generate_altered_index_together
    index_together=new_model_state.options['index_together'],
KeyError: u'index_together'

Change History (4)

comment:1 by Tim Graham, 10 years ago

comment:2 by Simon Charette, 10 years ago

Triage Stage: AcceptedReady for checkin

Added some minor nitpick comments on the PR. If the build succeeds this should be RFC.

comment:3 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In e0cd07ec2f394e6db3d17de19809a8f377cd1578:

Fixed #22903 -- Fixed migration generation if index_together or unique_together is removed from a model.

comment:4 by Tim Graham <timograham@…>, 10 years ago

In f1428dc796817a241d49319122663129d78ca853:

[1.7.x] Fixed #22903 -- Fixed migration generation if index_together or unique_together is removed from a model.

Backport of e0cd07ec2f from master

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