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: 20160125193410_create_avaliation_recovery_diary_record.rb
    path of file: ./repos/i-diario/db/migrate
    
    the code of the file until where you have to start completion: class CreateAvaliationRecoveryDiaryRecord < ActiveRecord::Migration[4.2]
  def change
    create_table :avaliation_recovery_diary_records do |t|
      t.references :recovery_diary_record, foreign_key: true
      t.references :avaliation, foreign_key: true
    end

    add_index(
      :avaliation_recovery_diary_records,
      :recovery_diary_record_id,
      unique: true,
      name: :index_aval
    
  def change
    create_table :avaliation_recovery_diary_records do |t|
      t.references :recovery_diary_record, foreign_key: true
      t.references :avaliation, foreign_key: true
    end

    add_index(
      :avaliation_recovery_diary_records,
      :recovery_diary_record_id,
      unique: true,
      name: :index_avaliation_recovery_diary_records_on_recovery_diary_id
    )

    add_index(
      :avaliation_recovery_diary_records,
      :avaliation_id,
      unique: true
    )

  end