diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-28 00:11:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-28 00:11:00 +0000 |
commit | e39b6277eb4f4560af5c541a79d890e8186f130e (patch) | |
tree | 748bfcc631f919e622e560250a464a30c7f458b1 /db | |
parent | 1f992463a93d2db88a661dd2a60a1f0a81375f44 (diff) | |
download | gitlab-ce-e39b6277eb4f4560af5c541a79d890e8186f130e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20221025220607_add_index_id_on_scan_finding_approval_merge_request_rules.rb | 17 | ||||
-rw-r--r-- | db/schema_migrations/20221025220607 | 1 | ||||
-rw-r--r-- | db/structure.sql | 2 |
3 files changed, 20 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 diff --git a/db/schema_migrations/20221025220607 b/db/schema_migrations/20221025220607 new file mode 100644 index 00000000000..30322b1ab3f --- /dev/null +++ b/db/schema_migrations/20221025220607 @@ -0,0 +1 @@ +d6eb5bb918f12c08f23c228916b7e21432e1e2958832c10be4e46dfa2079103d
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 570417ccbb6..7f9d177a3ea 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -31078,6 +31078,8 @@ CREATE UNIQUE INDEX partial_index_sop_configs_on_project_id ON security_orchestr CREATE INDEX partial_index_user_id_app_id_created_at_token_not_revoked ON oauth_access_tokens USING btree (resource_owner_id, application_id, created_at) WHERE (revoked_at IS NULL); +CREATE INDEX scan_finding_approval_mr_rule_index_id ON approval_merge_request_rules USING btree (id) WHERE (report_type = 4); + CREATE INDEX scan_finding_approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id) WHERE (report_type = 4); CREATE INDEX scan_finding_approval_project_rule_index_created_at_project_id ON approval_project_rules USING btree (created_at, project_id) WHERE (report_type = 4); |