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: 20161219131051_add_payment_mode_to_outgoing_payment_list.rb
    path of file: ./repos/ekylibre/db/migrate
    
    the code of the file until where you have to start completion: class AddPaymentModeToOutgoingPaymentList < ActiveRecord::Migration[4.2]
  def up
    add_reference :outgoi
    
  def up
    add_reference :outgoing_payment_lists, :mode, index: true
    reversible do |r|
      r.up do
        execute <<-SQL.strip_heredoc
          UPDATE "outgoing_payment_lists"
            SET "mode_id" = "outgoing_payments"."mode_id"
            FROM "outgoing_payments"
            WHERE "outgoing_payments"."list_id" = "outgoing_payment_lists"."id"
SQL
      end
    end
    change_column_null :outgoing_payment_lists, :mode_id, false

    add_column :outgoing_payments, :position, :integer
  end