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 ...@@ -4,6 +4,7 @@ class AddFingerprintIndex < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
# https://gitlab.com/gitlab-org/gitlab-ee/issues/764
def change def change
args = [:keys, :fingerprint] args = [:keys, :fingerprint]
...@@ -11,6 +12,6 @@ class AddFingerprintIndex < ActiveRecord::Migration ...@@ -11,6 +12,6 @@ class AddFingerprintIndex < ActiveRecord::Migration
args << { algorithm: :concurrently } args << { algorithm: :concurrently }
end end
add_index(*args) add_index(*args) unless index_exists?(:keys, :fingerprint)
end end
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