Index

public.course_module_suotar_configurations

Description

Per-module Suotar credit registration configuration, the per-module pause, and the config-validation phase’s last verdict. At most one live row per course module; no row means the module is not configured, which is not an error.

Columns

Name Type Default Nullable Children Parents Comment
checked_course_code varchar(255) true The course code course_code_allowed is a verdict on. Once the module’s uh_course_code changes, the verdict no longer applies.
config_check_message text true Human-readable detail from the last config check.
config_checked_at timestamp with time zone true When the config-validation phase last checked this module. NULL means never checked, so the admin view can show unknown instead of implying a passing check it never ran.
consecutive_listing_failures integer 0 false Failed listing attempts since the last successful one.
course_code_allowed boolean true Whether Suotar accepted the module’s course code at the last config check. NULL means not checked, or checked without Suotar giving a verdict.
course_code_rejection text true Suotar’s own reason for not accepting checked_course_code, quoted to operators. NULL unless course_code_allowed is false.
course_module_id uuid false public.course_modules The module this configuration is for. No ON DELETE clause: course modules are only ever soft-deleted, and the pause record must not be able to vanish.
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.
last_listed_at timestamp with time zone true When enrolment discovery last listed this module’s course code successfully.
last_listing_attempted_at timestamp with time zone true When enrolment discovery last tried to list this module’s course code, whether or not the roster arrived. Orders the listing queue, so a module that keeps failing cannot starve the rest.
last_listing_error credit_registration_error_code true Why the last listing attempt failed, null once one succeeds. What separates a failed listing from an empty course.
pause_reason text true Why credit registration was paused for this module.
paused_at timestamp with time zone true While set, no pipeline phase claims rows for this module and the module renders as paused rather than broken. Pausing does not rewrite ledger states, which is what makes resuming a no-op.
paused_by_user_id uuid true public.users Who paused credit registration for this module. Set exactly when paused_at is.
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_module_suotar_config_consecutive_listing_failur_not_null n NOT NULL consecutive_listing_failures
course_module_suotar_configurations_check_result CHECK CHECK (((config_checked_at IS NOT NULL) OR (course_code_allowed IS NULL)))
course_module_suotar_configurations_course_module_id_fkey FOREIGN KEY FOREIGN KEY (course_module_id) REFERENCES course_modules(id)
course_module_suotar_configurations_course_module_id_not_null n NOT NULL course_module_id
course_module_suotar_configurations_created_at_not_null n NOT NULL created_at
course_module_suotar_configurations_id_not_null n NOT NULL id
course_module_suotar_configurations_pause_pair CHECK CHECK (((paused_at IS NULL) = (paused_by_user_id IS NULL)))
course_module_suotar_configurations_paused_by_user_id_fkey FOREIGN KEY FOREIGN KEY (paused_by_user_id) REFERENCES users(id)
course_module_suotar_configurations_pkey PRIMARY KEY PRIMARY KEY (id)
course_module_suotar_configurations_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
course_module_suotar_configurations_pkey CREATE UNIQUE INDEX course_module_suotar_configurations_pkey ON public.course_module_suotar_configurations USING btree (id)
uq_course_module_suotar_configurations CREATE UNIQUE INDEX uq_course_module_suotar_configurations ON public.course_module_suotar_configurations USING btree (course_module_id)

Triggers

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

Relations

er

Generated by tbls