-
Notifications
You must be signed in to change notification settings - Fork 549
/
20100401102949_create_tables.rb
46 lines (39 loc) · 1.37 KB
/
20100401102949_create_tables.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class CreateTables < ActiveRecord::Migration
def change
create_table :users do |t|
## Database authenticatable
t.string :email, :null => true, :default => ""
t.string :encrypted_password, :null => true, :default => ""
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at
## Confirmable
t.string :confirmation_token
t.datetime :confirmed_at
t.datetime :confirmation_sent_at
t.string :unconfirmed_email # Only if using reconfirmable
t.string :username
t.integer :profile_id
t.boolean :active
## Invitable
t.string :invitation_token, :limit => 60
t.datetime :invitation_created_at
t.datetime :invitation_sent_at
t.datetime :invitation_accepted_at
t.integer :invitation_limit
t.integer :invited_by_id
t.string :invited_by_type
t.integer :invitations_count, :default => 0
t.timestamps
end
add_index :users, :invitation_token, :unique => true
add_index :users, :invitations_count
create_table :admins do |t|
## Database authenticatable
t.string :email, :null => true, :default => ""
t.string :encrypted_password, :null => true, :default => ""
t.integer :invitations_count, :default => 0
end
add_index :admins, :invitations_count
end
end