Commit e0ea0eea authored by charlie ablett's avatar charlie ablett

Remove inconsistent index

- and restore it exactly upon down
parent 01a8bb6f
---
title: Remove inconsistent index in backup_labels table
merge_request: 53189
author:
type: other
# frozen_string_literal: true
class DropBackupLabelIndex < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
INDEX_NAME = 'backup_labels_project_id_title_idx'
def up
remove_concurrent_index_by_name(:backup_labels, name: INDEX_NAME)
end
def down
add_concurrent_index :backup_labels, [:project_id, :title], name: INDEX_NAME, unique: true, where: 'group_id = NULL::integer'
end
end
b8a19b2ebf648a1b79a488a7a2847f6a392e594464c1ba0ae96f274f583559e3
\ No newline at end of file
......@@ -21023,8 +21023,6 @@ CREATE INDEX backup_labels_group_id_title_idx ON backup_labels USING btree (grou
CREATE INDEX backup_labels_project_id_idx ON backup_labels USING btree (project_id);
CREATE UNIQUE INDEX backup_labels_project_id_title_idx ON backup_labels USING btree (project_id, title) WHERE (group_id = NULL::integer);
CREATE INDEX backup_labels_template_idx ON backup_labels USING btree (template) WHERE template;
CREATE INDEX backup_labels_title_idx ON backup_labels USING btree (title);
......
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