debian-mirror-gitlab/db/migrate/20160412173418_add_ci_commit_indexes.rb
2019-02-13 22:33:31 +05:30

20 lines
450 B
Ruby

# rubocop:disable all
class AddCiCommitIndexes < ActiveRecord::Migration[4.2]
disable_ddl_transaction!
def change
add_index :ci_commits, [:gl_project_id, :sha], index_options
add_index :ci_commits, [:gl_project_id, :status], index_options
add_index :ci_commits, [:status], index_options
end
private
def index_options
if Gitlab::Database.postgresql?
{ algorithm: :concurrently }
else
{ }
end
end
end