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

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

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

  TABLE_NAME = :ci_pipeline_variables
  INDEX_NAME = 'index_ci_pipeline_variables_on_pipeline_id_bigint_and_key'
  COLUMNS = [:pipeline_id_convert_to_bigint, :key]

  def up
    add_concurrent_index TABLE_NAME, COLUMNS, unique: true, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
  end
end