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

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

class AddIndexToEventsAuthorGroupActionTargetType < Gitlab::Database::Migration[2.2]
  milestone '16.9'

  disable_ddl_transaction!

  INDEX_NAME = 'index_events_author_id_group_id_action_target_type_created_at'
  COLUMNS = [:author_id, :group_id, :action, :target_type, :created_at]

  def up
    add_concurrent_index :events, COLUMNS, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :events, INDEX_NAME
  end
end