Opened 8 years ago

Closed 8 years ago

#27520 closed Bug (duplicate)

sqlmigrate generates a duplicate DROP INDEX statement (migrate works fine)

Reported by: Jerome Leclanche Owned by: nobody
Component: Migrations Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I just removed db_index=True on a CharField I no longer want indexed, on postgresql, Django 1.10. The migration runs fine (it removes both the _like and regular index), but when I run sqlmigrate it actually generates *three* "DROP INDEX" statements instead of two: one of the two is duplicated.

Results of sqlmigrate:

BEGIN;
--
-- Alter field real_name on globalgameplayer
--
DROP INDEX "games_globalgameplayer_real_name_7e583535_like";
DROP INDEX "games_globalgameplayer_real_name_7e583535_uniq";
DROP INDEX "games_globalgameplayer_real_name_7e583535_like";
COMMIT;

Of course, running this doesn't work. Simply running migrate however will work fine.

Reference commit: https://github.com/HearthSim/HSReplay.net/commit/cdbae94d0bf397c1c9d6362d847e0ca120f0385b

Change History (1)

comment:1 by Tim Graham, 8 years ago

Component: UncategorizedMigrations
Resolution: duplicate
Status: newclosed
Type: UncategorizedBug

This is fixed in master (Django 1.11) by 9356f63a99957f01c14a9788617428a172a29fcb (#25317, #26090).

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