summaryrefslogtreecommitdiff
path: root/db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb
blob: 55b4636987010301bca8387436124755f34ed452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

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

  # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/408936
  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