Index

public.user_details

Description

Contains the details of user accounts such as their email, names, etc. It is not possible to soft delete these records – only hard deletes are supported in this table.

Columns

Name Type Default Nullable Extra Definition Children Parents Comment
created_at timestamp with time zone now() false Timestamp when the record was created.
email varchar(255) false User’s email
first_name varchar(255) true The first name that the user has provided to the system.
last_name varchar(255) true The last name that the user has provided to the system.
search_helper text true GENERATED ALWAYS AS lower(replace((((((((((user_id)::text ’ ’::text)
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 this record belongs to.

Constraints

Name Type Definition
user_details_email_check CHECK CHECK (((email)::text ~~ ‘%@%’::text))
user_details_first_name_check CHECK CHECK ((TRIM(BOTH FROM first_name) <> ’’::text))
user_details_last_name_check CHECK CHECK ((TRIM(BOTH FROM last_name) <> ’’::text))
user_details_pkey PRIMARY KEY PRIMARY KEY (user_id)
user_details_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id)

Indexes

Name Definition
user_details_pkey CREATE UNIQUE INDEX user_details_pkey ON public.user_details USING btree (user_id)
user_details_search_helper_gist CREATE INDEX user_details_search_helper_gist ON public.user_details USING gist (search_helper gist_trgm_ops)
user_details_search_helper_lower CREATE INDEX user_details_search_helper_lower ON public.user_details USING btree (lower(search_helper))
users_email CREATE UNIQUE INDEX users_email ON public.user_details USING btree (lower((email)::text))

Triggers

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

Relations

er

Generated by tbls