diff options
Diffstat (limited to 'db/post_migrate/20221025220607_add_index_id_on_scan_finding_approval_merge_request_rules.rb')
-rw-r--r-- | db/post_migrate/20221025220607_add_index_id_on_scan_finding_approval_merge_request_rules.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20221025220607_add_index_id_on_scan_finding_approval_merge_request_rules.rb b/db/post_migrate/20221025220607_add_index_id_on_scan_finding_approval_merge_request_rules.rb new file mode 100644 index 00000000000..4e72e7f95ec --- /dev/null +++ b/db/post_migrate/20221025220607_add_index_id_on_scan_finding_approval_merge_request_rules.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexIdOnScanFindingApprovalMergeRequestRules < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'scan_finding_approval_mr_rule_index_id' + SCAN_FINDING_REPORT_TYPE = 4 + + disable_ddl_transaction! + + def up + add_concurrent_index :approval_merge_request_rules, :id, + where: "report_type = #{SCAN_FINDING_REPORT_TYPE}", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :approval_merge_request_rules, INDEX_NAME + end +end |