summaryrefslogtreecommitdiff
path: root/db/post_migrate/20200807110237_add_migration_index_to_vulnerabilities_occurrences.rb
blob: e806a337f8fca5401d917b5d4379b8caf3266d54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

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

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :vulnerability_occurrences,
      "project_id, report_type, encode(project_fingerprint, 'hex'::text)",
      name: 'index_vulnerability_occurrences_for_issue_links_migration'
  end

  def down
    remove_concurrent_index_by_name :vulnerability_occurrences,
      :index_vulnerability_occurrences_for_issue_links_migration
  end
end