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

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

class AddUniqueIdPartitionIdIndexToCiBuildMetadata < Gitlab::Database::Migration[2.0]
  TABLE_NAME = :ci_builds_metadata
  INDEX_NAME = :index_ci_builds_metadata_on_id_partition_id_unique

  def up
    prepare_async_index(TABLE_NAME, %i[id partition_id], unique: true, name: INDEX_NAME)
  end

  def down
    unprepare_async_index(:ci_builds_metadata, %i[id partition_id], name: INDEX_NAME)
  end
end