diff options
Diffstat (limited to 'db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb')
-rw-r--r-- | db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb b/db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb new file mode 100644 index 00000000000..3013de7c31b --- /dev/null +++ b/db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropSoftwareLicensesTempIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :software_licenses + INDEX_NAME = 'tmp_index_for_software_licenses_spdx_identifier_cleanup' + + def up + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_index TABLE_NAME, :spdx_identifier, where: 'spdx_identifier IS NULL', name: INDEX_NAME + end +end |