]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
MySQL: Ignore unique indexes when removing implicit indexes
authorJohannes Erdfelt <johannes@erdfelt.com>
Thu, 4 Dec 2014 17:42:46 +0000 (09:42 -0800)
committerJohannes Erdfelt <johannes@erdfelt.com>
Thu, 4 Dec 2014 17:55:07 +0000 (09:55 -0800)
commit22667c19df7e30469b61f901cd6404f5d3a5cc14
treec6f7597b89045d827fd0a8eeae3c7afa71965b38
parent6d5155de3491b9c52c673de5d07920872cdca808
MySQL: Ignore unique indexes when removing implicit indexes

MySQL will implicitly create indexes when using foreign keys. Alembic
attempts to remove those implicit indexes so they don't appear as
removes when comparing metadata.

However, unique indexes with the same name as a column are considered
as possibly implicitly created causing alembic to emit a spurious
'remove_constraint'.

Since MySQL will never implicitly create unique indexes, they can be
safely ignored when removing the implicit indexes.

Fixes #251
alembic/ddl/mysql.py
tests/test_autogen_indexes.py