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 28339 Expand the docs around how sqlmigrate works with regards to constraint and index names Craig de Stigter nobody "1. Make a field with `db_index=True` (for `ForeignKey`, django sets this by default) 2. Make a migration. This creates an index: {{{ #!sql CREATE INDEX ""a_c_b_id_5a026661"" ON ""a_c"" (""b_id""); }}} 3. Explicitly set `db_index=False` and create another migration 4. Check `sqlmigrate` for the new migration. Index is never actually removed: {{{ #!sql BEGIN; -- -- Alter field b on c -- COMMIT; }}} One note: This is with postgres settings. I'm not sure if it's db-specific." Cleanup/optimization new Documentation 1.11 Normal Accepted 0 0 0 0 0 0