diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170625151955_devise_create_users.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/db/migrate/20170625151955_devise_create_users.rb b/db/migrate/20170625151955_devise_create_users.rb new file mode 100644 index 0000000..799f225 --- /dev/null +++ b/db/migrate/20170625151955_devise_create_users.rb | |||
@@ -0,0 +1,44 @@ | |||
1 | class DeviseCreateUsers < ActiveRecord::Migration[5.1] | ||
2 | def change | ||
3 | create_table :users do |t| | ||
4 | ## Database authenticatable | ||
5 | t.string :login, null: false, default: "" | ||
6 | t.string :email, null: false, default: "" | ||
7 | t.string :encrypted_password, null: false, default: "" | ||
8 | |||
9 | ## Recoverable | ||
10 | t.string :reset_password_token | ||
11 | t.datetime :reset_password_sent_at | ||
12 | |||
13 | ## Rememberable | ||
14 | t.datetime :remember_created_at | ||
15 | |||
16 | ## Trackable | ||
17 | t.integer :sign_in_count, default: 0, null: false | ||
18 | t.datetime :current_sign_in_at | ||
19 | t.datetime :last_sign_in_at | ||
20 | t.string :current_sign_in_ip | ||
21 | t.string :last_sign_in_ip | ||
22 | |||
23 | ## Confirmable | ||
24 | # t.string :confirmation_token | ||
25 | # t.datetime :confirmed_at | ||
26 | # t.datetime :confirmation_sent_at | ||
27 | # t.string :unconfirmed_email # Only if using reconfirmable | ||
28 | |||
29 | ## Lockable | ||
30 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts | ||
31 | # t.string :unlock_token # Only if unlock strategy is :email or :both | ||
32 | # t.datetime :locked_at | ||
33 | |||
34 | |||
35 | t.timestamps null: false | ||
36 | end | ||
37 | |||
38 | add_index :users, :login, unique: true | ||
39 | add_index :users, :email, unique: true | ||
40 | add_index :users, :reset_password_token, unique: true | ||
41 | # add_index :users, :confirmation_token, unique: true | ||
42 | # add_index :users, :unlock_token, unique: true | ||
43 | end | ||
44 | end | ||