debian-mirror-gitlab/db/post_migrate/20230313184306_add_temp_index_for_software_license_cleanup.rb
2023-05-27 22:25:52 +05:30

16 lines
430 B
Ruby

# frozen_string_literal: true
class AddTempIndexForSoftwareLicenseCleanup < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
INDEX_NAME = 'tmp_index_for_software_licenses_spdx_identifier_cleanup'
def up
add_concurrent_index :software_licenses, :spdx_identifier, where: 'spdx_identifier IS NULL', name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :software_licenses, INDEX_NAME
end
end