2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/generators/ruby_cms/templates/db/migrate/20260525150000_create_invitations.rb', line 2
def change
create_table :invitations, if_not_exists: true do |t|
t.string :email, null: false
t.string :token, null: false
t.boolean :admin, null: false, default: false
t.integer :invited_by_id
t.datetime :expires_at, null: false
t.datetime :accepted_at
t.datetime :revoked_at
t.datetime :last_sent_at
t.timestamps
end
add_index :invitations, :token, unique: true, if_not_exists: true
add_index :invitations, :email, if_not_exists: true
add_index :invitations, :expires_at, if_not_exists: true
add_index :invitations, :accepted_at, if_not_exists: true
add_index :invitations, :invited_by_id, if_not_exists: true
end
|