diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /db/post_migrate/20201113105000_update_index_secure_for_api_fuzzing_telemetry.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'db/post_migrate/20201113105000_update_index_secure_for_api_fuzzing_telemetry.rb')
-rw-r--r-- | db/post_migrate/20201113105000_update_index_secure_for_api_fuzzing_telemetry.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/db/post_migrate/20201113105000_update_index_secure_for_api_fuzzing_telemetry.rb b/db/post_migrate/20201113105000_update_index_secure_for_api_fuzzing_telemetry.rb new file mode 100644 index 00000000000..9e8313f79f8 --- /dev/null +++ b/db/post_migrate/20201113105000_update_index_secure_for_api_fuzzing_telemetry.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class UpdateIndexSecureForApiFuzzingTelemetry < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + disable_ddl_transaction! + + OLD_SECURE_INDEX_NAME = 'index_secure_ci_builds_on_user_id_created_at_parser_features' + NEW_SECURE_INDEX_NAME = 'index_secure_ci_builds_on_user_id_name_created_at' + + def up + add_concurrent_index(:ci_builds, + [:user_id, :name, :created_at], + where: "(((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text, ('secret_detection'::character varying)::text])))", + name: NEW_SECURE_INDEX_NAME) + remove_concurrent_index_by_name :ci_builds, OLD_SECURE_INDEX_NAME + end + + def down + add_concurrent_index(:ci_builds, + [:user_id, :created_at], + where: "(((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text])))", + name: OLD_SECURE_INDEX_NAME) + remove_concurrent_index_by_name :ci_builds, NEW_SECURE_INDEX_NAME + end +end |