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

20201002094617_remove_container_scanning_report_type_index.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a591fc185c44412c8f400f2a1dde2155772e424a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

class RemoveContainerScanningReportTypeIndex < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'idx_container_scanning_findings'

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name(:vulnerability_occurrences, INDEX_NAME)
  end

  def down
    # report_type: 2 container scanning
    add_concurrent_index(
      :vulnerability_occurrences,
      :id,
      where: 'report_type = 2',
      name: INDEX_NAME
    )
  end
end