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

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

class AddNewIndexToVsaMrStageEvents < Gitlab::Database::Migration[2.1]
  include Gitlab::Database::PartitioningMigrationHelpers

  TABLE_NAME = :analytics_cycle_analytics_merge_request_stage_events
  COLUMN_NAMES = %I[stage_event_hash_id group_id end_event_timestamp merge_request_id]
  INDEX_NAME = 'index_mr_stage_events_for_consistency_check'

  disable_ddl_transaction!

  def up
    add_concurrent_partitioned_index TABLE_NAME, COLUMN_NAMES, name: INDEX_NAME
  end

  def down
    remove_concurrent_partitioned_index_by_name TABLE_NAME, INDEX_NAME
  end
end