Refine columns in the users table
This commit is contained in:
parent
d9ab2f5091
commit
63c7bc8772
@ -3,18 +3,26 @@
|
||||
# Table name: users
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# confirmation_sent_at :datetime
|
||||
# confirmation_token :string
|
||||
# confirmed_at :datetime
|
||||
# email :string default(""), not null
|
||||
# encrypted_password :string default(""), not null
|
||||
# remember_created_at :datetime
|
||||
# failed_attempts :integer default(0), not null
|
||||
# locked_at :datetime
|
||||
# reset_password_sent_at :datetime
|
||||
# reset_password_token :string
|
||||
# unconfirmed_email :string
|
||||
# unlock_token :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_users_on_confirmation_token (confirmation_token) UNIQUE
|
||||
# index_users_on_email (email) UNIQUE
|
||||
# index_users_on_reset_password_token (reset_password_token) UNIQUE
|
||||
# index_users_on_unlock_token (unlock_token) UNIQUE
|
||||
#
|
||||
class User < ApplicationRecord
|
||||
devise :database_authenticatable, :registerable,
|
||||
|
@ -12,7 +12,7 @@ class DeviseCreateUsers < ActiveRecord::Migration[8.0]
|
||||
t.datetime :reset_password_sent_at
|
||||
|
||||
## Rememberable
|
||||
t.datetime :remember_created_at
|
||||
# t.datetime :remember_created_at
|
||||
|
||||
## Trackable
|
||||
# t.integer :sign_in_count, default: 0, null: false
|
||||
@ -22,15 +22,15 @@ class DeviseCreateUsers < ActiveRecord::Migration[8.0]
|
||||
# t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
# t.datetime :confirmed_at
|
||||
# t.datetime :confirmation_sent_at
|
||||
# t.string :unconfirmed_email # Only if using reconfirmable
|
||||
t.string :confirmation_token
|
||||
t.datetime :confirmed_at
|
||||
t.datetime :confirmation_sent_at
|
||||
t.string :unconfirmed_email # Only if using reconfirmable
|
||||
|
||||
## Lockable
|
||||
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
# t.datetime :locked_at
|
||||
t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
||||
t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
t.datetime :locked_at
|
||||
|
||||
|
||||
t.timestamps null: false
|
||||
@ -38,7 +38,7 @@ class DeviseCreateUsers < ActiveRecord::Migration[8.0]
|
||||
|
||||
add_index :users, :email, unique: true
|
||||
add_index :users, :reset_password_token, unique: true
|
||||
# add_index :users, :confirmation_token, unique: true
|
||||
# add_index :users, :unlock_token, unique: true
|
||||
add_index :users, :confirmation_token, unique: true
|
||||
add_index :users, :unlock_token, unique: true
|
||||
end
|
||||
end
|
||||
|
10
db/schema.rb
generated
10
db/schema.rb
generated
@ -191,11 +191,19 @@ ActiveRecord::Schema[8.0].define(version: 2024_11_30_095753) do
|
||||
t.string "encrypted_password", default: "", null: false
|
||||
t.string "reset_password_token"
|
||||
t.datetime "reset_password_sent_at"
|
||||
t.datetime "remember_created_at"
|
||||
t.string "confirmation_token"
|
||||
t.datetime "confirmed_at"
|
||||
t.datetime "confirmation_sent_at"
|
||||
t.string "unconfirmed_email"
|
||||
t.integer "failed_attempts", default: 0, null: false
|
||||
t.string "unlock_token"
|
||||
t.datetime "locked_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "groups", "groups", column: "parent_id"
|
||||
|
Loading…
x
Reference in New Issue
Block a user