Skip to content

Resolve "Inconsistent schema - tmp_index_ci_pipelines_lock_version index"

Diogo Frazão requested to merge 349549-inconsistent-schema-index-4 into master

What does this MR do and why?

In this MR, we are removing the following index (if exists):

  • tmp_index_ci_pipelines_lock_version

up:

== 20220109133006 RemoveCiPipelinesLockVersionIndex: migrating ================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:ci_pipelines, :id, {:where=>"lock_version IS NULL", :name=>"tmp_index_ci_pipelines_lock_version", :algorithm=>:concurrently})
   -> 0.0074s
-- remove_index(:ci_pipelines, {:where=>"lock_version IS NULL", :name=>"tmp_index_ci_pipelines_lock_version", :algorithm=>:concurrently, :column=>:id})
   -> 0.0076s
== 20220109133006 RemoveCiPipelinesLockVersionIndex: migrated (0.0163s) =======

down:

== 20220109133006 RemoveCiPipelinesLockVersionIndex: reverting ================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:ci_pipelines, :id, {:where=>"lock_version IS NULL", :name=>"tmp_index_ci_pipelines_lock_version", :algorithm=>:concurrently})
   -> 0.0086s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- add_index(:ci_pipelines, :id, {:where=>"lock_version IS NULL", :name=>"tmp_index_ci_pipelines_lock_version", :algorithm=>:concurrently})
   -> 0.0024s
-- execute("RESET statement_timeout")
   -> 0.0005s
== 20220109133006 RemoveCiPipelinesLockVersionIndex: reverted (0.0137s) =======

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #349549 (closed)

Edited by Diogo Frazão

Merge request reports