Commit 87878732 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'remove-temporary-ci-index' into 'master'

Remove a temporary index on ci_builds meant only for earlier migration

See merge request gitlab-org/gitlab-ce!14378
parents 6b45a012 23b58e54
---
title: Remove an index on ci_builds meant to be only temporary
merge_request:
author:
type: other
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class RemoveTemporaryCiBuildsIndex < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
# To use create/remove index concurrently
disable_ddl_transaction!
def up
return unless index_exists?(:ci_builds, :id, name: 'index_for_ci_builds_retried_migration')
remove_concurrent_index(:ci_builds, :id, name: "index_for_ci_builds_retried_migration")
end
def down
# this was a temporary index for a migration that was never
# present previously so this probably shouldn't be here but it's
# easier to test the drop if we have a way to create it.
add_concurrent_index("ci_builds", ["id"],
name: "index_for_ci_builds_retried_migration",
where: "(retried IS NULL)",
using: :btree)
end
end
......@@ -256,7 +256,6 @@ ActiveRecord::Schema.define(version: 20170921115009) do
add_index "ci_builds", ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type", using: :btree
add_index "ci_builds", ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref", using: :btree
add_index "ci_builds", ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref", using: :btree
add_index "ci_builds", ["id"], name: "index_for_ci_builds_retried_migration", where: "(retried IS NULL)", using: :btree
add_index "ci_builds", ["project_id"], name: "index_ci_builds_on_project_id", using: :btree
add_index "ci_builds", ["protected"], name: "index_ci_builds_on_protected", using: :btree
add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree
......
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