Index

public.user_research_consents

Description

Stores information whether a student has consented to participate on research done on courses

Columns

Name Type Default Nullable Children Parents Comment
created_at timestamp with time zone now() false Timestamp when the record was created.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
id uuid uuid_generate_v4() false
research_consent boolean false false Whether or not the student has given a consent to research
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 for which the consent belongs to

Constraints

Name Type Definition
user_id_when_not_deleted UNIQUE UNIQUE NULLS NOT DISTINCT (user_id, deleted_at)
user_research_consents_pkey PRIMARY KEY PRIMARY KEY (id)
user_research_consents_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id)

Indexes

Name Definition
user_id_when_not_deleted CREATE UNIQUE INDEX user_id_when_not_deleted ON public.user_research_consents USING btree (user_id, deleted_at) NULLS NOT DISTINCT
user_research_consents_pkey CREATE UNIQUE INDEX user_research_consents_pkey ON public.user_research_consents USING btree (id)

Triggers

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

Relations

er

Generated by tbls