summaryrefslogtreecommitdiff
path: root/db/migrate/20201016074302_add_index_project_id_and_id_to_container_repositories.rb
blob: b2e7c62ba0c7c345eb9f5671d09bf93faf441b30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

class AddIndexProjectIdAndIdToContainerRepositories < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'index_container_repositories_on_project_id_and_id'

  disable_ddl_transaction!

  def up
    add_concurrent_index(:container_repositories, [:project_id, :id], name: INDEX_NAME)
  end

  def down
    remove_concurrent_index(:container_repositories, [:project_id, :id], name: INDEX_NAME)
  end
end