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

20201004163918_remove_project_id_and_id_index_from_vulnerabilities_table.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7a59e706bf3db21f40fe6779df8698bb288f538a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class RemoveProjectIdAndIdIndexFromVulnerabilitiesTable < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id'

  disable_ddl_transaction!

  def up
    Gitlab::BackgroundMigration.steal('PopulateResolvedOnDefaultBranchColumn')
    remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME
  end

  def down
    add_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
  end
end