Commit daa29729 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Add indexes concurrently on PostgreSQL

parent 10253707
class AddCiCommitIndexes < ActiveRecord::Migration
disable_ddl_transaction!
def change
add_index :ci_commits, [:gl_project_id, :sha]
add_index :ci_commits, [:gl_project_id, :status]
add_index :ci_commits, [:status]
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
def index_options
{ algorithm: :concurrently } if Gitlab::Database.postgresql?
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