You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 20231207145335_cleanup_group_level_work_items.rb
    path of file: ./repos/gitlabhq/db/post_migrate
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class CleanupGroupLevelWorkItems < Gitlab::Database::Migra
    
  def up
    MigrationIssue.where(project_id: nil).each_batch(of: BATCH_SIZE) do |batch|
      logger.info("deleting #{batch.size} issues at group level: #{batch.pluck(:id)}")

      # cleaning up notes for the batch of issues
      MigrationNote.where(noteable_type: 'Issue', noteable_id: batch).each_batch(of: BATCH_SIZE) do |note_batch|
        logger.info("deleting #{note_batch.size} notes for issues at group level: #{note_batch.pluck(:id)}")
        note_batch.delete_all
      end

      # cleaning up label links for the batch of issues
      MigrationLabelLink.where(target_type: 'Issue', target_id: batch).each_batch(of: BATCH_SIZE) do |label_link_batch|
        logger.info(
          "deleting #{label_link_batch.size} label links for issues at group level: #{label_link_batch.pluck(:id)}"
        )
        label_link_batch.delete_all
      end

      # cleaning up todos for the batch of issues
      MigrationTodo.where(target_type: 'Issue', target_id: batch).each_batch(of: BATCH_SIZE) do |todo_batch|
        logger.info("deleting #{todo_batch.size} todos for issues at group level: #{todo_batch.pluck(:id)}")
        todo_batch.delete_all
      end

      batch.delete_all
    end
  end