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

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

class PrepareAsyncIndexForCiPipelinesBigintId < Gitlab::Database::Migration[2.1]
  TABLE_NAME = :ci_pipelines
  INDEX_NAME = "index_#{TABLE_NAME}_on_id_convert_to_bigint"

  # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/397000
  def up
    prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME
  end

  def down
    unprepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME
  end
end