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: 20150130125824_create_user_roles.rb
    path of file: ./repos/i-diario/db/migrate
    
    the code of the file until where you have to start completion: class CreateUserRoles < ActiveRecord::Migration[4.2]
  def change
    create_table :user_roles do |t|
      t.integer :user_id, null: false
      t.integer :role_id, null: false
      t.integer :unity_id

      t.timestamps
    end
    add_index :user
    
  def change
    create_table :user_roles do |t|
      t.integer :user_id, null: false
      t.integer :role_id, null: false
      t.integer :unity_id

      t.timestamps
    end
    add_index :user_roles, :user_id
    add_index :user_roles, :role_id
    add_index :user_roles, :unity_id
    add_foreign_key :user_roles, :users
    add_foreign_key :user_roles, :roles
    add_foreign_key :user_roles, :unities
  end