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: 20240122015626_fill_poll_create_allowed_groups_based_on_deprecated_setting.rb
    path of file: ./repos/discourse/plugins/poll/db/post_migrate
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class FillPollCreateAllowedGroupsBasedOnDeprecatedSetting < ActiveRecord::Migration[7.0]
  def up
    old_setting_trust_level =
      DB.query_single(
        "SELECT value FROM site_sett
    
  def up
    old_setting_trust_level =
      DB.query_single(
        "SELECT value FROM site_settings WHERE name = 'poll_minimum_trust_level_to_create' LIMIT 1",
      ).first

    if old_setting_trust_level.present?
      allowed_groups = "1#{old_setting_trust_level}"

      DB.exec(
        "INSERT INTO site_settings(name, value, data_type, created_at, updated_at)
        VALUES('poll_create_allowed_groups', :setting, '20', NOW(), NOW())",
        setting: allowed_groups,
      )
    end