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. The enable_credit_registration_via_suotar rollout switch stays on course_modules instead, because it is read on the per-user my-studies path for every logged-in user.
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| 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 together with the two check booleans means never checked, so the admin view can show unknown instead of implying a passing check it never ran. | |||
| course_code_resolves | boolean | true | Whether the configured course code resolved at the last config check. NULL means not checked yet. | |||
| 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. | |||
| grade_scale_id | varchar(64) | true | Per-module override of the Sisu grade scale id. NULL means derive it from the completion. | |||
| id | uuid | uuid_generate_v4() | false | A unique, stable identifier for the record. | ||
| open_university_product_id | varchar(255) | true | The open university product used to build Sisu enrolment links for this module. | |||
| 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. | ||
| product_token_found | boolean | true | Whether an access token was found for the configured product at the last config check. NULL means not checked yet. | |||
| 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. |
| Name | Type | Definition |
|---|---|---|
| course_module_suotar_configurations_check_result | CHECK | CHECK (((config_checked_at IS NULL) = ((course_code_resolves IS NULL) AND (product_token_found 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 |
| 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) |
| Name | Definition |
|---|---|
| set_timestamp | CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.course_module_suotar_configurations FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp() |
Generated by tbls