Commit d90648aa authored by Andreas Brandl's avatar Andreas Brandl

Merge branch '198652-update-index-on-license-scanning' into 'master'

Include `license_scanning` to Ci::Build index

See merge request gitlab-org/gitlab!24090
parents 9ac70062 3baa2f7e
---
title: Include license_scanning to index_ci_builds_on_name_for_security_products_values
merge_request: 24090
author:
type: changed
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class UdpateIndexCiBuildsOnNameForSecurityProducts < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_ci_builds_on_name_for_security_products_values'
INDEX_NAME_NEW = 'index_ci_builds_on_name_for_security_reports_values'
INITIAL_INDEX = "((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text"
disable_ddl_transaction!
def up
add_concurrent_index(:ci_builds,
:name,
name: INDEX_NAME_NEW,
where: INITIAL_INDEX + ", ('license_scanning'::character varying)::text]))")
remove_concurrent_index_by_name(:ci_builds, INDEX_NAME)
end
def down
add_concurrent_index(:ci_builds,
:name,
name: INDEX_NAME,
where: INITIAL_INDEX + ']))')
remove_concurrent_index_by_name(:ci_builds, INDEX_NAME_NEW)
end
end
......@@ -682,7 +682,7 @@ ActiveRecord::Schema.define(version: 2020_02_07_151640) do
t.index ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type"
t.index ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref"
t.index ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref"
t.index ["name"], name: "index_ci_builds_on_name_for_security_products_values", where: "((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text]))"
t.index ["name"], name: "index_ci_builds_on_name_for_security_reports_values", where: "((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text, ('license_scanning'::character varying)::text]))"
t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id"
t.index ["project_id", "name", "ref"], name: "index_ci_builds_on_project_id_and_name_and_ref", where: "(((type)::text = 'Ci::Build'::text) AND ((status)::text = 'success'::text) AND ((retried = false) OR (retried IS NULL)))"
t.index ["project_id", "status"], name: "index_ci_builds_project_id_and_status_for_live_jobs_partial2", where: "(((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text])))"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment