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: 20170221204204_add_show_subcategory_list_to_categories.rb
    path of file: ./repos/discourse/db/migrate
    
    the code of the file until where you have to start completion: # frozen_
    
  def up
    add_column :categories, :show_subcategory_list, :boolean, default: false

    result =
      execute(
        "select count(1) from site_settings where name = 'show_subcategory_list' and value = 't'",
      )
    if result[0] && result[0]["count"].to_i > (0)
      execute "UPDATE categories SET show_subcategory_list = true WHERE parent_category_id IS NULL"
    end