Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23880 closed Bug (fixed)

SQLite's schema editor doesn't handle index_together

Reported by: Markus Holtermann Owned by: Markus Holtermann
Component: Database layer (models, ORM) Version: 1.7
Severity: Release blocker Keywords:
Cc: Markus Holtermann 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

The SQLite schema editor doesn't handle index_together changes. This manifests itself when renaming a field that is part of index_together.

I came across the bug when fixing https://code.djangoproject.com/ticket/23859#comment:6 . After RenameField's database_forwards() has run the index is missing.

Traceback (most recent call last):
  File "/home/jenkins/workspace/django-pull-requests/database/sqlite3/python/python3.4/tests/migrations/test_operations.py", line 1016, in test_rename_field
    self.assertIndexExists("test_rnfl_pony", ["weight", "blue"])
  File "/home/jenkins/workspace/django-pull-requests/database/sqlite3/python/python3.4/tests/migrations/test_base.py", line 46, in assertIndexExists
    for c in connection.introspection.get_constraints(cursor, table).values()
AssertionError: True != False

Change History (6)

comment:1 by Tim Graham, 10 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Markus Holtermann, 10 years ago

Owner: changed from nobody to Markus Holtermann
Status: newassigned

comment:3 by Markus Holtermann, 10 years ago

Has patch: set

comment:4 by Loic Bistuer, 10 years ago

Triage Stage: AcceptedReady for checkin

LGTM

comment:5 by Loic Bistuer <loic.bistuer@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In d2202ec2d4d0477b682c6d0051f27ab4843ef89f:

Fixed #23880 -- Added missing index_together handling for SQLite

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

In ba3e97618696bdd68e4ac9b2220f58e6b3d15bd4:

[1.7.x] Fixed #23880 -- Added missing index_together handling for SQLite

Backport of d2202ec2d4d0477b682c6d0051f27ab4843ef89f from master

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