Avoid adding index if already exists
This commit is contained in:
parent
797fe0a6e6
commit
d2f4e8f97d
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue