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

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

class AddIndexToSnippetOnProjectId < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers
  INDEX_NAME = "index_snippet_on_id_and_project_id"
  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :snippets, [:id, :project_id], name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :snippets, INDEX_NAME
  end
end