Commit 8bdc899f authored by Rémy Coutable's avatar Rémy Coutable

Make AddIndexToProjectAuthorizations reversable

Don't try to create the index if it already exist. It's possible that a
previous rollback did not remove the index since the index is not
dropped on MySQL because MySQL would also drop the foreign key in that
case, see f67d8eb1.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 709b8162
......@@ -6,7 +6,9 @@ class AddIndexToProjectAuthorizations < ActiveRecord::Migration
disable_ddl_transaction!
def up
add_concurrent_index(:project_authorizations, :project_id)
unless index_exists?(:project_authorizations, :project_id)
add_concurrent_index(:project_authorizations, :project_id)
end
end
def down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment