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: 20220930133418_set_duration_for_milestone_work_packages.rb
    path of file: ./repos/openproject/db/migrate
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is an open source project management software.
# Copyr
    
  def set_duration(table)
    execute <<~SQL.squish
      UPDATE
        #{table}
      SET
        duration = 1
      WHERE
        EXISTS (
          SELECT * FROM types type
          WHERE
            type.is_milestone = TRUE AND
            type.id = #{table}.type_id
        )
    SQL
  end