Index

public.course_designer_plan_stages

Description

Per-plan stage schedule and actual progress data for the fixed MOOC course design stages.

Columns

Name Type Default Nullable Children Parents Comment
actual_completed_at timestamp with time zone true Timestamp when this stage was marked completed.
actual_started_at timestamp with time zone true Timestamp when work on this stage actually started.
course_designer_plan_id uuid false public.course_designer_plans The plan this stage schedule row belongs to.
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 public.course_designer_plan_stage_tasks A unique, stable identifier for the record.
planned_ends_on date false Planned end date for this stage.
planned_starts_on date false Planned start date for this stage.
stage course_designer_stage false Which fixed workflow stage this row represents.
status course_designer_plan_stage_status ‘not_started’::course_designer_plan_stage_status false Manual progress status for the stage.
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.
workspace_data jsonb true Stage-specific workspace payload (e.g. Analysis form). Nullable until the user saves.

Constraints

Name Type Definition
course_designer_plan_stages_check CHECK CHECK ((planned_starts_on <= planned_ends_on))
course_designer_plan_stages_check1 CHECK CHECK (((actual_started_at IS NULL) OR (actual_completed_at IS NULL) OR (actual_started_at <= actual_completed_at)))
course_designer_plan_stages_course_designer_plan_id_fkey FOREIGN KEY FOREIGN KEY (course_designer_plan_id) REFERENCES course_designer_plans(id)
course_designer_plan_stages_course_designer_plan_id_not_null n NOT NULL course_designer_plan_id
course_designer_plan_stages_created_at_not_null n NOT NULL created_at
course_designer_plan_stages_id_not_null n NOT NULL id
course_designer_plan_stages_pkey PRIMARY KEY PRIMARY KEY (id)
course_designer_plan_stages_plan_stage_unique UNIQUE UNIQUE NULLS NOT DISTINCT (course_designer_plan_id, stage, deleted_at)
course_designer_plan_stages_planned_ends_on_not_null n NOT NULL planned_ends_on
course_designer_plan_stages_planned_starts_on_not_null n NOT NULL planned_starts_on
course_designer_plan_stages_stage_not_null n NOT NULL stage
course_designer_plan_stages_status_not_null n NOT NULL status
course_designer_plan_stages_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
course_designer_plan_stages_pkey CREATE UNIQUE INDEX course_designer_plan_stages_pkey ON public.course_designer_plan_stages USING btree (id)
course_designer_plan_stages_plan_stage_unique CREATE UNIQUE INDEX course_designer_plan_stages_plan_stage_unique ON public.course_designer_plan_stages USING btree (course_designer_plan_id, stage, deleted_at) NULLS NOT DISTINCT

Triggers

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

Relations

er

Generated by tbls