feature/share-libs
rb 44 lines 1.39 KB
Raw
1 # frozen_string_literal: true
2
3 class DeviseCreateAdminUsers < ActiveRecord::Migration[5.2]
4 def change
5 create_table :admin_users do |t|
6 ## Database authenticatable
7 t.string :email, null: false, default: ""
8 t.string :encrypted_password, null: false, default: ""
9
10 ## Recoverable
11 t.string :reset_password_token
12 t.datetime :reset_password_sent_at
13
14 ## Rememberable
15 t.datetime :remember_created_at
16
17 ## Trackable
18 t.integer :sign_in_count, default: 0, null: false
19 t.datetime :current_sign_in_at
20 t.datetime :last_sign_in_at
21 t.inet :current_sign_in_ip
22 t.inet :last_sign_in_ip
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, null: false # 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
36 t.timestamps null: false
37 end
38
39 add_index :admin_users, :email, unique: true
40 add_index :admin_users, :reset_password_token, unique: true
41 # add_index :admin_users, :confirmation_token, unique: true
42 # add_index :admin_users, :unlock_token, unique: true
43 end
44 end