master
1class DeviseCreateUsers < ActiveRecord::Migration
2 def self.up
3 create_table(:users) do |t|
4 ## Database authenticatable
5 t.string :email, :null => false, :default => ""
6 t.string :encrypted_password, :null => false, :default => ""
7 ## Recoverable
8 t.string :reset_password_token
9 t.datetime :reset_password_sent_at
10
11 ## Rememberable
12 t.datetime :remember_created_at
13
14 ## Trackable
15 t.integer :sign_in_count, :default => 0
16 t.datetime :current_sign_in_at
17 t.datetime :last_sign_in_at
18 t.string :current_sign_in_ip
19 t.string :last_sign_in_ip
20
21 ## Encryptable
22 # t.string :password_salt
23
24 ## Confirmable
25 # t.string :confirmation_token
26 # t.datetime :confirmed_at
27 # t.datetime :confirmation_sent_at
28 # t.string :unconfirmed_email # Only if using reconfirmable
29
30 ## Lockable
31 # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
32 # t.string :unlock_token # Only if unlock strategy is :email or :both
33 # t.datetime :locked_at
34
35 # Token authenticatable
36 # t.string :authentication_token
37
38 ## Invitable
39 # t.string :invitation_token
40
41 t.timestamps
42 end
43
44 add_index :users, :email, :unique => true
45 add_index :users, :reset_password_token, :unique => true
46 # add_index :users, :confirmation_token, :unique => true
47 # add_index :users, :unlock_token, :unique => true
48 # add_index :users, :authentication_token, :unique => true
49 end
50
51 def self.down
52 drop_table :users
53 end
54end