2018-03-17 18:26:18 +05:30
|
|
|
# rubocop:disable all
|
2018-12-23 12:14:25 +05:30
|
|
|
class AddFingerprintIndex < ActiveRecord::Migration[4.2]
|
2018-03-17 18:26:18 +05:30
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab-ee/issues/764
|
|
|
|
def change
|
|
|
|
args = [:keys, :fingerprint]
|
|
|
|
|
|
|
|
if Gitlab::Database.postgresql?
|
|
|
|
args << { algorithm: :concurrently }
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index(*args) unless index_exists?(:keys, :fingerprint)
|
|
|
|
end
|
|
|
|
end
|