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.course_background_questions public.course_instance_enrollments public.credit_registrations public.pending_roles public.roles public.student_countries public.user_course_settings 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.

Viewpoints

Name Definition
Credit registration How a completed course module becomes a credit in the University of Helsinki study registry. Enrolment on the course is itself the student’s consent to register the credit; once a student number is proven to be theirs, one ledger row per completion is pushed to Sisu through Suotar and polled until the registry confirms the attainment.

Constraints

Name Type Definition
course_instances_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
course_instances_course_id_not_null n NOT NULL course_id
course_instances_created_at_not_null n NOT NULL created_at
course_instances_has_only_one_default_instance_per_course UNIQUE UNIQUE NULLS NOT DISTINCT (course_id, name, deleted_at)
course_instances_id_not_null n NOT NULL id
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_email_not_null n NOT NULL teacher_in_charge_email
course_instances_teacher_in_charge_name_check CHECK CHECK ((TRIM(BOTH FROM teacher_in_charge_name) <> ’’::text))
course_instances_teacher_in_charge_name_not_null n NOT NULL teacher_in_charge_name
course_instances_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
course_instances_course_id_idx CREATE INDEX course_instances_course_id_idx ON public.course_instances USING btree (course_id)
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