blob: 1ceaa1b5aef5470657f42278b7c9a61f9fc63892 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# frozen_string_literal: true
class DeleteIssueMergeRequestTaggingsRecords < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_issue_mr'
BATCH_SIZE = 3_000
TAGGABLE_TYPES = %w(Issue MergeRequest)
def up
sleep 2 while ActsAsTaggableOn::Tagging.where(taggable_type: TAGGABLE_TYPES).limit(BATCH_SIZE).delete_all > 0
remove_concurrent_index_by_name :taggings, INDEX_NAME
end
def down
end
end
|