Index

public.staff_security_verified_browsers

Description

Browsers a user with a role has confirmed with an emailed code. Half of the check that a staff session is really its owner: a session is recognized only from a remembered browser on a verified network. Expired rows are hard-deleted.

Columns

Name Type Default Nullable Children Parents Comment
created_at timestamp with time zone now() false Timestamp when the record was created.
expires_at timestamp with time zone false When the browser stops being remembered. Pushed forward when the browser is used.
id uuid uuid_generate_v4() false public.staff_security_verified_networks A unique, stable identifier for the record.
token_digest bytea false SHA-256 of the random token in the browser’s cookie. The token itself is never stored.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.
user_id uuid false public.users The user who verified this browser.

Constraints

Name Type Definition
staff_security_verified_browsers_created_at_not_null n NOT NULL created_at
staff_security_verified_browsers_expires_at_not_null n NOT NULL expires_at
staff_security_verified_browsers_id_not_null n NOT NULL id
staff_security_verified_browsers_pkey PRIMARY KEY PRIMARY KEY (id)
staff_security_verified_browsers_token_digest_check CHECK CHECK ((length(token_digest) = 32))
staff_security_verified_browsers_token_digest_key UNIQUE UNIQUE (token_digest)
staff_security_verified_browsers_token_digest_not_null n NOT NULL token_digest
staff_security_verified_browsers_updated_at_not_null n NOT NULL updated_at
staff_security_verified_browsers_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
staff_security_verified_browsers_user_id_not_null n NOT NULL user_id

Indexes

Name Definition
staff_security_verified_browsers_expires_at CREATE INDEX staff_security_verified_browsers_expires_at ON public.staff_security_verified_browsers USING btree (expires_at)
staff_security_verified_browsers_pkey CREATE UNIQUE INDEX staff_security_verified_browsers_pkey ON public.staff_security_verified_browsers USING btree (id)
staff_security_verified_browsers_token_digest_key CREATE UNIQUE INDEX staff_security_verified_browsers_token_digest_key ON public.staff_security_verified_browsers USING btree (token_digest)
staff_security_verified_browsers_user_id CREATE INDEX staff_security_verified_browsers_user_id ON public.staff_security_verified_browsers USING btree (user_id)

Triggers

Name Definition
set_timestamp CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.staff_security_verified_browsers FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls