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

class RequireReviewableScores < ActiveRecord::Migration[5.2]
  def up
    min_score =
      DB.query_single(
        "SELECT value FROM site_settings WHERE name = 'min_score_default_visibility'",
      )[
        0
      ].to_f
    min_
    
  def up
    min_score =
      DB.query_single(
        "SELECT value FROM site_settings WHERE name = 'min_score_default_visibility'",
      )[
        0
      ].to_f
    min_score = 1.0 if (min_score < 1.0)

    execute(<<~SQL)
      INSERT INTO reviewable_scores (
        reviewable_id,
        user_id,
        reviewable_score_type,
        score,
        status,
        created_at,
        updated_at
      )
      SELECT r.id,
        -1,
        9,
        #{min_score},
        r.status,
        r.created_at,
        r.created_at
      FROM reviewables AS r
      WHERE r.type IN ('ReviewableQueuedPost', 'ReviewableUser')
    SQL

    execute(<<~SQL)
      UPDATE reviewables SET score = (
        SELECT COALESCE(SUM(score), 0)
        FROM reviewable_scores
        WHERE reviewable_scores.reviewable_id = reviewables.id
      )
    SQL
  end