Resolve "Inconsistent schema - indexes"
What does this MR do and why?
We already have index_on_projects_path
index on production, but we could not find it in structure.sql and migrations.
In this MR, we are adding a new migration to add this index (if not exist).
up:
== 20220114105525 AddIndexOnProjectsPath: migrating ===========================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:projects, :path, {:name=>"index_on_projects_path", :algorithm=>:concurrently})
-> 0.0131s
-- add_index(:projects, :path, {:name=>"index_on_projects_path", :algorithm=>:concurrently})
-> 0.0018s
== 20220114105525 AddIndexOnProjectsPath: migrated (0.0160s) ==================
down:
== 20220114105525 AddIndexOnProjectsPath: reverting ===========================
-- transaction_open?()
-> 0.0000s
-- index_exists?(:projects, :path, {:name=>"index_on_projects_path", :algorithm=>:concurrently})
-> 0.0566s
-- execute("SET statement_timeout TO 0")
-> 0.0006s
-- remove_index(:projects, {:name=>"index_on_projects_path", :algorithm=>:concurrently, :column=>:path})
-> 0.0195s
-- execute("RESET statement_timeout")
-> 0.0005s
== 20220114105525 AddIndexOnProjectsPath: reverted (0.0810s) ==================
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #349549 (closed)
Edited by Diogo Frazão