Commit 3fa8fa9e authored by Cameron Swords's avatar Cameron Swords

Remove index as it will no longer be used

parent 0a367278
# frozen_string_literal: true
class AddIndexToBuildOptions < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_build_on_options'
disable_ddl_transaction!
def up
add_concurrent_index :ci_builds, :options,
name: INDEX_NAME,
using: :gist,
opclass: :gist_trgm_ops,
where: "options like '%:artifacts:%:reports:%:sast:%'" \
" or options like '%:artifacts:%:reports:%:dast:%'" \
" or options like '%:artifacts:%:reports:%:dependency_scanning:%'" \
" or options like '%:artifacts:%:reports:%:container_scanning:%'"
end
def down
remove_concurrent_index_by_name :ci_builds, INDEX_NAME
end
end
...@@ -644,7 +644,6 @@ ActiveRecord::Schema.define(version: 2019_10_04_134055) do ...@@ -644,7 +644,6 @@ ActiveRecord::Schema.define(version: 2019_10_04_134055) do
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", "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 ["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_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 ["options"], name: "index_build_on_options", opclass: :gist_trgm_ops, where: "((options ~~ '%:artifacts:%:reports:%:sast:%'::text) OR (options ~~ '%:artifacts:%:reports:%:dast:%'::text) OR (options ~~ '%:artifacts:%:reports:%:dependency_scanning:%'::text) OR (options ~~ '%:artifacts:%:reports:%:container_scanning:%'::text))", using: :gist
t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id" t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id"
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])))" 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])))"
t.index ["project_id"], name: "index_ci_builds_on_project_id_for_successfull_pages_deploy", where: "(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text))" t.index ["project_id"], name: "index_ci_builds_on_project_id_for_successfull_pages_deploy", where: "(((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::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