Allow bulk alter to drop and recreate named index
In 3809c80c, adding an index with a name that's already in use was changed from an error to a warning, to allow other statements in the same migration to complete successfully. In 55d0d57b this decision was reversed, but instead of allowing the statement to execute and raise an adapter- specific error as it did before, an `ArgumentError` was raised instead. This interferes with a legitimate use case: on MySQL, it's possible to drop an index and add another one with the same name in a single `ALTER` statement. Right now an `ArgumentError` is raised when trying to do so, even though the resulting statement would execute successfully. There's no corresponding `ArgumentError` raised when attempting to add a duplicate column, so I think we can safely remove the check and allow the adapter to raise its own error about duplicate indexes again.
Showing
想要评论请 注册 或 登录