Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

auth.otp

Description

Stores temporal otp code for up to 15 minutes

Columns

NameTypeDefaultNullableParents
otp_passtextfalse
otp_timestamptimestamp with time zonenow()true
otp_triessmallint‘0’::smallintfalse
user_emailcitextfalseauth.accounts

Constraints

NameTypeDefinition
otp_otp_pass_not_nullnNOT NULL otp_pass
otp_otp_tries_not_nullnNOT NULL otp_tries
otp_pkeyPRIMARY KEYPRIMARY KEY (user_email)
otp_user_email_fkeyFOREIGN KEYFOREIGN KEY (user_email) REFERENCES auth.accounts(email) ON DELETE RESTRICT
otp_user_email_not_nullnNOT NULL user_email

Indexes

NameDefinition
otp_pass_idxCREATE INDEX otp_pass_idx ON auth.otp USING btree (otp_pass)
otp_pkeyCREATE UNIQUE INDEX otp_pkey ON auth.otp USING btree (user_email)

Relations

erDiagram

"auth.otp" |o--|| "auth.accounts" : "FOREIGN KEY (user_email) REFERENCES auth.accounts(email) ON DELETE RESTRICT"
"auth.vessels" }o--|| "auth.accounts" : "FOREIGN KEY (owner_email) REFERENCES auth.accounts(email) ON DELETE RESTRICT"

"auth.otp" {
  text otp_pass ""
  timestamp_with_time_zone otp_timestamp ""
  smallint otp_tries ""
  citext user_email FK ""
}
"auth.accounts" {
  timestamp_with_time_zone connected_at ""
  timestamp_with_time_zone created_at ""
  citext email ""
  text first "User first name with CONSTRAINT CHECK"
  integer id ""
  text last "User last name with CONSTRAINT CHECK"
  text pass ""
  jsonb preferences ""
  name role ""
  timestamp_with_time_zone updated_at ""
  text user_id ""
}
"auth.vessels" {
  timestamp_with_time_zone created_at ""
  numeric mmsi "MMSI can be optional but if present must be a valid one and unique but must be in numeric range between 100000000 and 800000000"
  text name ""
  citext owner_email FK ""
  name role ""
  timestamp_with_time_zone updated_at ""
  text vessel_id ""
}

Generated by tbls