Add indexes concurrently on PostgreSQL
This commit is contained in:
parent
102537072b
commit
daa29729cc
1 changed files with 9 additions and 3 deletions
|
@ -1,7 +1,13 @@
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue