﻿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
27064	Implement RenameIndex in a backwards compatible way	Markus Holtermann	David Wobrock	"In order to eventually deprecate `index_together` we need a way to deal with old projects that have unnamed indexes. This proves to be a non-trivial problem. Andrew and I came up with these things to consider.

* `RenameIndex(model, new_name, old_name=None, old_fields=None)` where exactly one of `old_name` and `old_field` is given (`old_name ^ old_fields`)
* If the old_name is given we use `RENAME INDEX` if available
* Otherwise look at the state and drop existing indexes and create new the index with new name
* On MySQL (or other DBs) that don't support `RENAME INDEX`, provide SQL query to look up index name from information_schema by field names and pass in to `DROP INDEX`.
* If more than one index is found while identifying with field names, migrations must error out with an `AmbiguityError`
* If the autodetector finds an old, unnamed index and a new, named one matching field signature, issue a `RenameIndex` operation
* For backwards operations with unnamed old indexes, `RenameIndex` is a noop."	New feature	closed	Migrations	dev	Normal	fixed		Andrew Godwin Akshesh Doshi Adam Johnson Ravi Teja P David Wobrock	Accepted	1	0	0	0	0	0
