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

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

class AddAsyncIndexForGroupActivityEvents < Gitlab::Database::Migration[2.0]
  INDEX_NAME = 'index_events_for_group_activity'

  def up
    prepare_async_index :events, %I[group_id target_type action id], name: INDEX_NAME, where: 'group_id IS NOT NULL'
  end

  def down
    unprepare_async_index :events, %I[group_id target_type action id], name: INDEX_NAME, where: 'group_id IS NOT NULL'
  end
end