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