debian-mirror-gitlab/db/post_migrate/20220803042352_cleanup_mr_attention_request_todos.rb
2022-08-27 11:52:29 +05:30

25 lines
513 B
Ruby

# frozen_string_literal: true
class CleanupMrAttentionRequestTodos < Gitlab::Database::Migration[2.0]
disable_ddl_transaction!
restrict_gitlab_migration gitlab_schema: :gitlab_main
class Todo < MigrationRecord
self.table_name = 'todos'
include ::EachBatch
ATTENTION_REQUESTED = 10
end
def up
Todo.where(action: Todo::ATTENTION_REQUESTED).each_batch do |todos_batch|
todos_batch.delete_all
end
end
def down
# Attention request feature has been reverted.
end
end