summaryrefslogtreecommitdiff
path: root/db/migrate/20221010202339_remove_unique_index_on_sbom_components_type_and_name.rb
blob: fe092232ca699576eed8930dba7f89646a3a88b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class RemoveUniqueIndexOnSbomComponentsTypeAndName < Gitlab::Database::Migration[2.0]
  INDEX_NAME = 'index_sbom_components_on_component_type_and_name'

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name :sbom_components, name: INDEX_NAME
  end

  def down
    add_concurrent_index :sbom_components, [:component_type, :name], unique: true, name: INDEX_NAME
  end
end