﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25863	RenameModel migration does not rename indexes, subsequent index creation fails	Jiri Baum	nobody	"The Django RenameModel operation does not rename indexes; this can lead to index name collisions later if the old model name is reused.

Steps to reproduce:
* Make a model ""A"" with at least one index (db_index=True or index_together or unique_together).
 * python manage.py makemigrations
* Rename model ""A"" to ""B"".
 * python manage.py makemigrations
* Create new model called ""A"", with some of the same fields and indexes.
 * python manage.py makemigrations
* Run tests (no tests need to exist for this step).
 * python manage.py test

Observed behaviour: django.db.utils.OperationalError: index polls_question_b61a98bd already exists

Expected behaviour: ""Ran 0 tests in 0.000s OK""

Comments:
* This is a regression; these steps do not give an error under Django 1.8.
 * I initially saw the error on upgrading to 1.9 and running the tests with already-existing migrations.
 * I have not checked whether the operation under Django 1.8 is correct, certainly the indexes are not renamed, but they do not give an error in normal use or in the test. It is possible that some corner cases in 1.8 will operate on the wrong index in this scenario.
* Our use case is that we renamed a model Foo to FooRaw, then created a new model Foo to contain a processed version of the data."	Bug	closed	Migrations	1.9	Normal	duplicate			Unreviewed	0	0	0	0	0	0
