class CreateInvitations < ActiveRecord::Migration
  def change
    create_table :invitations do |t|
      t.belongs_to :provider, null: false, default: nil
      t.belongs_to :subject, null: false, default: nil
      t.string :identifier, null: false, default: nil
      t.string :email, null: false, default: nil
      t.boolean :used, null: false, default: false
      t.timestamp :expires, null: false, default: nil
      t.timestamps

      t.index :identifier, unique: true
    end
  end
end

class CreateInvitations < ActiveRecord::Migration
  def change
    create_table :invitations do |t|
      t.belongs_to :provider, null: false, default: nil
      t.belongs_to :subject, null: false, default: nil
      t.string :identifier, null: false, default: nil
      t.string :name, null: false, default: nil
      t.string :mail, null: false, default: nil
      t.boolean :used, null: false, default: false
      t.timestamp :expires, null: false, default: nil
      t.timestamps

      t.index :identifier, unique: true
    end
  end
end

Adjust invitation columns to mirror subject better
Adjust invitation columns to mirror subject better

When creating an invitation, we want to capture the name and email
address entered by the administrator for auditing purposes. If there is
ever a question about where an invite went and why somebody else claimed
it, we can look here for clues.
