Opened 9 years ago
Closed 9 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=Trueon 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 runsqlmigrateit 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 , 9 years ago
| Component: | Uncategorized → Migrations |
|---|---|
| Resolution: | → duplicate |
| Status: | new → closed |
| Type: | Uncategorized → Bug |
This is fixed in master (Django 1.11) by 9356f63a99957f01c14a9788617428a172a29fcb (#25317, #26090).