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: base.rb
    path of file: ./repos/discourse/script/import_scripts
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

if ARGV.include?("bbcode-to-md")
  # Replace (most) 
    
  def update_topic_status
    puts "", "Updating topic status"

    DB.exec <<~SQL
      UPDATE topics AS t
      SET closed = TRUE
      WHERE EXISTS(
          SELECT 1
          FROM topic_custom_fields AS f
          WHERE f.topic_id = t.id AND f.name = 'import_closed' AND f.value = 't'
      )
    SQL

    DB.exec <<~SQL
      UPDATE topics AS t
      SET archived = TRUE
      WHERE EXISTS(
          SELECT 1
          FROM topic_custom_fields AS f
          WHERE f.topic_id = t.id AND f.name = 'import_archived' AND f.value = 't'
      )
    SQL

    DB.exec <<~SQL
      DELETE FROM topic_custom_fields
      WHERE name IN ('import_closed', 'import_archived')
    SQL
  end