You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. # frozen_string_literal: true
  2. class DeviseCreateUsers < ActiveRecord::Migration[7.0]
  3. def change
  4. create_table :users do |t|
  5. ## Database authenticatable
  6. t.string :email, null: false, default: ""
  7. t.string :encrypted_password, null: false, default: ""
  8. ## Recoverable
  9. t.string :reset_password_token
  10. t.datetime :reset_password_sent_at
  11. ## Rememberable
  12. t.datetime :remember_created_at
  13. ## Trackable
  14. # t.integer :sign_in_count, default: 0, null: false
  15. # t.datetime :current_sign_in_at
  16. # t.datetime :last_sign_in_at
  17. # t.string :current_sign_in_ip
  18. # t.string :last_sign_in_ip
  19. ## Confirmable
  20. # t.string :confirmation_token
  21. # t.datetime :confirmed_at
  22. # t.datetime :confirmation_sent_at
  23. # t.string :unconfirmed_email # Only if using reconfirmable
  24. ## Lockable
  25. # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
  26. # t.string :unlock_token # Only if unlock strategy is :email or :both
  27. # t.datetime :locked_at
  28. t.timestamps null: false
  29. end
  30. add_index :users, :email, unique: true
  31. add_index :users, :reset_password_token, unique: true
  32. # add_index :users, :confirmation_token, unique: true
  33. # add_index :users, :unlock_token, unique: true
  34. end
  35. end