Index

public.course_instances

Description

Allows teachers to use a course multiple times with different points, submissions, and enrollments.

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid false public.courses The course instance is an instance of this course.
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.
description varchar(255) true
ends_at timestamp with time zone true Timestamp when the course instance ceases to be available to the students.
id uuid uuid_generate_v4() false public.certificate_configuration_to_requirements public.cheater_thresholds public.course_background_questions public.course_instance_enrollments public.course_module_completions public.email_templates public.exercise_slide_submissions public.offered_answers_to_peer_review_temporary public.peer_or_self_review_submissions public.peer_review_queue_entries public.pending_roles public.roles public.student_countries public.user_course_instance_exercise_service_variables public.user_course_settings public.user_exercise_states A unique, stable identifier for the record.
name varchar(255) true A human readable description of the course instance, should tell students who are supposed to pick this course instance e.g. “For students that are participating in the Open University course BIRD-001.”.
starts_at timestamp with time zone true Timestamp when the course instance is available to the students.
support_email varchar(255) true
teacher_in_charge_email varchar(255) false
teacher_in_charge_name varchar(255) false
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
course_instances_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
course_instances_has_only_one_default_instance_per_course UNIQUE UNIQUE NULLS NOT DISTINCT (course_id, name, deleted_at)
course_instances_pkey PRIMARY KEY PRIMARY KEY (id)
course_instances_support_email_check CHECK CHECK (((support_email)::text ~~ ‘%@%’::text))
course_instances_teacher_in_charge_email_check CHECK CHECK (((teacher_in_charge_email)::text ~~ ‘%@%’::text))
course_instances_teacher_in_charge_name_check CHECK CHECK ((TRIM(BOTH FROM teacher_in_charge_name) <> ’’::text))

Indexes

Name Definition
course_instances_has_only_one_default_instance_per_course CREATE UNIQUE INDEX course_instances_has_only_one_default_instance_per_course ON public.course_instances USING btree (course_id, name, deleted_at) NULLS NOT DISTINCT
course_instances_pkey CREATE UNIQUE INDEX course_instances_pkey ON public.course_instances USING btree (id)

Triggers

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

Relations

er

Generated by tbls