Modules with a course code, completions_can_be_registered_to_sisu on, and credit registration not paused. The gate every phase that spends work on a module shares; every way out of it freezes what is in flight rather than cancelling it, so a query filtering on membership must leave the rows it stops seeing alone.
CREATE VIEW credit_registration_active_course_modules AS (
SELECT cm.id AS course_module_id,
cm.course_id
FROM (course_modules cm
LEFT JOIN course_module_suotar_configurations conf ON (((conf.course_module_id = cm.id) AND (conf.deleted_at IS NULL))))
WHERE ((TRIM(BOTH FROM cm.uh_course_code) <> ''::text) AND cm.completions_can_be_registered_to_sisu AND (cm.deleted_at IS NULL) AND (conf.paused_at IS NULL))
)| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| course_id | uuid | true | ||||
| course_module_id | uuid | true |
| Name | Columns | Comment | Type |
|---|---|---|---|
| public.course_modules | 17 | A module is a collection of chapters which can be used to categorise the chapters of a course. | BASE TABLE |
| public.course_module_suotar_configurations | 17 | 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. | BASE TABLE |
| cm.uh_course_code | 0 |
Generated by tbls