Commit 996e5ac9 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch '53989-remove-redundant-index' into 'master'

Remove redundant indices on GitLab.com

Closes gitlab-ce#53993 and gitlab-ce#53989

See merge request gitlab-org/gitlab-ee!8695
parents 22a74429 5698411a
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20181126153547) do
ActiveRecord::Schema.define(version: 20181203154104) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......
---
title: Remove redundant indices for is_sample on push_rules and next_execution_timestamp on project_mirror_data
merge_request: 8695
author:
type: performance
# 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 RemoveRedundantIndicesForProjectMirrorDataAndPushRules < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
remove_concurrent_index(*index_on_project_mirror_data)
remove_concurrent_index(*index_on_push_rules)
end
def down
add_concurrent_index(*index_on_push_rules)
add_concurrent_index(*index_on_project_mirror_data)
end
private
def index_on_project_mirror_data
[
:project_mirror_data,
[:next_execution_timestamp],
{ name: 'index_project_mirror_data_on_next_execution_timestamp' }
]
end
def index_on_push_rules
[
:push_rules,
[:is_sample],
{ name: 'index_push_rules_is_sample' }
]
end
end
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