提交 d2f4e8f9 编写于 作者: P Paco Guzman 提交者: James Edwards-Jones

Avoid adding index if already exists

上级 797fe0a6
......@@ -4,6 +4,7 @@ class AddFingerprintIndex < ActiveRecord::Migration
DOWNTIME = false
# https://gitlab.com/gitlab-org/gitlab-ee/issues/764
def change
args = [:keys, :fingerprint]
......@@ -11,6 +12,6 @@ class AddFingerprintIndex < ActiveRecord::Migration
args << { algorithm: :concurrently }
end
add_index(*args)
add_index(*args) unless index_exists?(:keys, :fingerprint)
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册