diff options
Diffstat (limited to 'db/migrate/20210114033715_remove_group_id_title_index.rb')
-rw-r--r-- | db/migrate/20210114033715_remove_group_id_title_index.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20210114033715_remove_group_id_title_index.rb b/db/migrate/20210114033715_remove_group_id_title_index.rb new file mode 100644 index 00000000000..8d63da3d400 --- /dev/null +++ b/db/migrate/20210114033715_remove_group_id_title_index.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveGroupIdTitleIndex < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = 'index_labels_on_group_id_and_title_with_null_project_id' + LABELS_TABLE = :labels + + def up + remove_concurrent_index_by_name LABELS_TABLE, INDEX_NAME + end + + def down + add_concurrent_index LABELS_TABLE, [:group_id, :title], where: 'project_id IS NULL', name: INDEX_NAME + end +end |