Commit d2f4e8f9 authored by Paco Guzman's avatar Paco Guzman Committed by James Edwards-Jones

Avoid adding index if already exists

parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment