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: backfill_project_settings.rb
    path of file: ./repos/gitlabhq/lib/gitlab/background_migration
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    # Back-fill project settings for projects that do not yet have one.
    class BackfillProjectSettings
     
    
      def perform(start_id, end_id, batch_table, batch_column, sub_batch_size, pause_ms)
        batch_relation = relation_scoped_to_range(batch_table, batch_column, start_id, end_id)

        batch_relation.each_batch(column: batch_column, of: sub_batch_size) do |sub_batch|
          insert_sql = <<~SQL
            INSERT INTO project_settings (project_id, created_at, updated_at)
            #{sub_batch.where(project_settings: { project_id: nil })
                       .select('projects.id, NOW(), NOW()')
                       .to_sql}
            ON CONFLICT (project_id) DO NOTHING
          SQL

          connection.execute(insert_sql)

          pause_ms = 0 if pause_ms < 0
          sleep(pause_ms * 0.001)
        end
      end