Commit 45b365b0 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'osw-clean-up-phase-for-diff-files-removal' into 'master'

Add clean-up phase for ScheduleDiffFilesDeletion migration

Closes #51469

See merge request gitlab-org/gitlab-ce!21734
parents b84b7433 18223f05
---
title: Add clean-up phase for ScheduleDiffFilesDeletion migration
merge_request: 21734
author:
type: other
# frozen_string_literal: true
class ConsumeRemainingDiffFilesDeletionJobs < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
MIGRATION = 'ScheduleDiffFilesDeletion'.freeze
TMP_INDEX = 'tmp_partial_diff_id_with_files_index'.freeze
def up
# Perform any ongoing background migration that might still be scheduled.
Gitlab::BackgroundMigration.steal(MIGRATION)
remove_concurrent_index_by_name(:merge_request_diffs, TMP_INDEX)
end
def down
add_concurrent_index(:merge_request_diffs, :id, where: "(state NOT IN ('without_files', 'empty'))", name: TMP_INDEX)
end
end
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