password_reset_token

-1 rows


Columns

Column Type Size Nulls Auto Default Children Parents Comments
password_reset_token_id uuid 2147483647 null
company_id uuid 2147483647 null
user_account.company_id fk_password_reset_token_user_company R
user_id uuid 2147483647 null
user_account.user_id fk_password_reset_token_user_company R
token_hash varchar 64 null
expires_at timestamptz 35,6 null
used_at timestamptz 35,6 null
created_at timestamptz 35,6 null
updated_at timestamptz 35,6 null
version int8 19 0

Indexes

Constraint Name Type Sort Column(s)
pk_password_reset_token Primary key Asc password_reset_token_id
idx_password_reset_token_active Performance Asc/Asc/Asc/Asc company_id + user_id + used_at + expires_at
idx_password_reset_token_company_user Performance Asc/Asc/Asc company_id + user_id + created_at
uq_password_reset_token_hash Must be unique Asc token_hash
uq_password_reset_token_id_company Must be unique Asc/Asc password_reset_token_id + company_id

Check Constraints

Constraint Name Constraint
ck_password_reset_token_expiry ((expires_at > created_at))
ck_password_reset_token_updated_at (((updated_at >= created_at) AND ((used_at IS NULL) OR (updated_at >= used_at))))
ck_password_reset_token_version ((version >= 0))
ck_password_reset_token_used_at (((used_at IS NULL) OR (used_at >= created_at)))
ck_password_reset_token_hash_length ((char_length((token_hash)::text) = 64))
ck_password_reset_token_hash_lowercase (((token_hash)::text = lower((token_hash)::text)))

Relationships