Index

public.certificate_configuration_to_requirements

Description

A join table that can be used to figure out what course modules and course instances are required to be completed to be eligible for a specific certificate. To find out all requirements one will need to query for all rows that match a certificate configuration id. Note that this is the correct table if you want a certificate to relate to a course or to courses because all courses have course modules and course instances.

Columns

Name Type Default Nullable Children Parents Comment
certificate_configuration_id uuid false public.certificate_configurations Identifies the certificate this requirement is for.
course_instance_id uuid true public.course_instances If defined, the referred course instance is a requirement for this certificate. If multiple course instances are a requirement for a certificate (multiple rows in this table), the user has to complete all of those course instances.
course_module_id uuid true public.course_modules If defined, the referred course module is a requirement for this certificate. If multiple course modules are a requirement for a certificate (multiple rows in this table), the user has to complete all of those course modules.
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 A unique, stable identifier for the record.
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.

Constraints

Name Type Definition
certificate_configuration_to__certificate_configuration_id_fkey FOREIGN KEY FOREIGN KEY (certificate_configuration_id) REFERENCES certificate_configurations(id)
certificate_configuration_to_requiremen_course_instance_id_fkey FOREIGN KEY FOREIGN KEY (course_instance_id) REFERENCES course_instances(id)
certificate_configuration_to_requirements_course_module_id_fkey FOREIGN KEY FOREIGN KEY (course_module_id) REFERENCES course_modules(id)
certificate_configuration_to_requirements_pkey PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
certificate_configuration_to_requirements_pkey CREATE UNIQUE INDEX certificate_configuration_to_requirements_pkey ON public.certificate_configuration_to_requirements USING btree (id)

Triggers

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

Relations

er

Generated by tbls