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

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

class AddIndexOnProjectsImportTypeId < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction!

  INDEX_NAME = 'index_imported_projects_on_import_type_id'

  def up
    add_concurrent_index(:projects, [:import_type, :id], where: 'import_type IS NOT NULL', name: INDEX_NAME)
  end

  def down
    remove_concurrent_index_by_name(:projects, INDEX_NAME)
  end
end