Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20230116090920_add_index_to_events_on_group_id_and_id.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4c2a9af7df9a9383b180af374c8f2d6a3f6e8685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class AddIndexToEventsOnGroupIdAndId < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  INDEX_NAME = 'index_events_on_group_id_and_id'

  def up
    add_concurrent_index :events, %i[group_id id], name: INDEX_NAME, where: 'group_id IS NOT NULL'
  end

  def down
    remove_concurrent_index_by_name :events, INDEX_NAME
  end
end