20130516033045_devise_create_admin_users.rb 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. class 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. t.string :name, :null => false, :default => ""
  8. t.boolean :is_super_admin, :null => false, :default => false
  9. ## Recoverable
  10. t.string :reset_password_token
  11. t.datetime :reset_password_sent_at
  12. ## Rememberable
  13. t.datetime :remember_created_at
  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. ## Confirmable
  21. # t.string :confirmation_token
  22. # t.datetime :confirmed_at
  23. # t.datetime :confirmation_sent_at
  24. # t.string :unconfirmed_email # Only if using reconfirmable
  25. ## Lockable
  26. # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
  27. # t.string :unlock_token # Only if unlock strategy is :email or :both
  28. # t.datetime :locked_at
  29. ## Token authenticatable
  30. # t.string :authentication_token
  31. t.timestamps
  32. end
  33. add_index :admin_users, :email, :unique => true
  34. add_index :admin_users, :reset_password_token, :unique => true
  35. # add_index :admin_users, :confirmation_token, :unique => true
  36. # add_index :admin_users, :unlock_token, :unique => true
  37. # add_index :admin_users, :authentication_token, :unique => true
  38. end
  39. end