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

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

class AddProjectNamespaceIndexToProject < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  INDEX_NAME = 'index_projects_on_project_namespace_id'

  def up
    add_concurrent_index :projects, :project_namespace_id, name: INDEX_NAME, unique: true
  end

  def down
    remove_concurrent_index_by_name :projects, INDEX_NAME
  end
end