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: 20140502134123_ticket_priority_to_enum.rb
    path of file: ./repos/brimir/db/migrate
    
    the code of the file until where you have to start completion: class TicketPriorityToEnum < ActiveRecord::Migration[4.2]
  class OldPriority < ActiveRecord::Base
    self.table_name = 'priorities'
    has_many :tickets, foreign_key: 'priority_id'
  end

  def change
    add_column :tickets, :priority, :integer, null: false, default: 0

    OldPriority.all.each do |priority|
      if priority.name == 'High'
        new_priority = :high
      elsif priority.name == '
    
  def change
    add_column :tickets, :priority, :integer, null: false, default: 0

    OldPriority.all.each do |priority|
      if priority.name == 'High'
        new_priority = :high
      elsif priority.name == 'Medium'
        new_priority = :medium
      elsif priority.name == 'Low'
        new_priority = :low
      else
        new_priority = :unknown
      end

      priority.tickets.each do |t|
        t.priority = new_priority
        t.save
      end
    end