Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid index name clashing with UNIQUE KEY
When we create a foreign key constraint for MySQL we also create an index, if there is not already an index beginning with the field in question. UNIQUEness constaint are implemented by indices, and so we should also skip adding an index if one already exists. To avoid changing existing fully-working schemas, this change only skips index creation if one with the same name already exists. This case currently fails with a duplicate key error in MySQL, eg., ERROR 1061 (42000): Duplicate key name 'foo'
- Loading branch information