diff options
Diffstat (limited to 'db/migrate/20221010202339_remove_unique_index_on_sbom_components_type_and_name.rb')
-rw-r--r-- | db/migrate/20221010202339_remove_unique_index_on_sbom_components_type_and_name.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20221010202339_remove_unique_index_on_sbom_components_type_and_name.rb b/db/migrate/20221010202339_remove_unique_index_on_sbom_components_type_and_name.rb new file mode 100644 index 00000000000..fe092232ca6 --- /dev/null +++ b/db/migrate/20221010202339_remove_unique_index_on_sbom_components_type_and_name.rb @@ -0,0 +1,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 |