Site para o estudio Velvet Design em São Paulo. http://velvetdesign.com.br

20140916035845_devise_create_users.rb 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. class DeviseCreateUsers < ActiveRecord::Migration
  2. def change
  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. ## Rememberable
  11. t.datetime :remember_created_at
  12. ## Trackable
  13. t.integer :sign_in_count, default: 0, null: false
  14. t.datetime :current_sign_in_at
  15. t.datetime :last_sign_in_at
  16. t.string :current_sign_in_ip
  17. t.string :last_sign_in_ip
  18. ## Confirmable
  19. # t.string :confirmation_token
  20. # t.datetime :confirmed_at
  21. # t.datetime :confirmation_sent_at
  22. # t.string :unconfirmed_email # Only if using reconfirmable
  23. ## Lockable
  24. # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
  25. # t.string :unlock_token # Only if unlock strategy is :email or :both
  26. # t.datetime :locked_at
  27. t.string :first_name
  28. t.string :last_name
  29. t.timestamps
  30. end
  31. add_index :users, :email, unique: true
  32. add_index :users, :reset_password_token, unique: true
  33. # add_index :users, :confirmation_token, unique: true
  34. # add_index :users, :unlock_token, unique: true
  35. end
  36. end