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

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

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

  disable_ddl_transaction!

  INDEX_NAME = 'index_issues_on_project_id_and_upvotes_count'

  def up
    add_concurrent_index :issues, [:project_id, :upvotes_count], name: INDEX_NAME
  end

  def down
    remove_concurrent_index :issues, [:project_id, :upvotes_count], name: INDEX_NAME
  end
end