BigW Consortium Gitlab

20150406133311_add_invite_data_to_member.rb 684 Bytes
Newer Older
1
class AddInviteDataToMember < ActiveRecord::Migration
2
  def up
3 4 5 6 7 8 9 10 11
    add_column :members, :created_by_id, :integer
    add_column :members, :invite_email, :string
    add_column :members, :invite_token, :string
    add_column :members, :invite_accepted_at, :datetime

    change_column :members, :user_id, :integer, null: true

    add_index :members, :invite_token, unique: true
  end
12 13 14 15 16 17 18 19 20 21 22

  def down
    remove_index :members, :invite_token

    change_column :members, :user_id, :integer, null: false

    remove_column :members, :invite_accepted_at
    remove_column :members, :invite_token
    remove_column :members, :invite_email
    remove_column :members, :created_by_id
  end
23
end