Index

public.course_designer_plan_section_statuses

Description

Ready or unfinished mark, with an optional comment, that plan members set on a section of a stage. A section with no row has not been marked.

Columns

Name Type Default Nullable Children Parents Comment
comment text true Optional note about the section, for example what is still missing.
course_designer_plan_id uuid false public.course_designer_plans The plan the section 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 A unique, stable identifier for the record.
section_key varchar(255) false Stable section identifier defined by the frontend forms, such as design.learning_goals. Opaque to the backend.
stage course_designer_stage false The stage the section belongs to.
status course_designer_section_status false Whether the section is ready or still unfinished.
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.
updated_by_user_id uuid false public.users User who last set the status or comment.

Constraints

Name Type Definition
course_designer_plan_section_s_course_designer_plan_id_not_null n NOT NULL course_designer_plan_id
course_designer_plan_section_statu_course_designer_plan_id_fkey FOREIGN KEY FOREIGN KEY (course_designer_plan_id) REFERENCES course_designer_plans(id)
course_designer_plan_section_status_updated_by_user_id_not_null n NOT NULL updated_by_user_id
course_designer_plan_section_statuses_comment_check CHECK CHECK ((length(comment) <= 5000))
course_designer_plan_section_statuses_created_at_not_null n NOT NULL created_at
course_designer_plan_section_statuses_id_not_null n NOT NULL id
course_designer_plan_section_statuses_pkey PRIMARY KEY PRIMARY KEY (id)
course_designer_plan_section_statuses_section_key_check CHECK CHECK ((TRIM(BOTH FROM section_key) <> ’’::text))
course_designer_plan_section_statuses_section_key_not_null n NOT NULL section_key
course_designer_plan_section_statuses_section_unique UNIQUE UNIQUE NULLS NOT DISTINCT (course_designer_plan_id, stage, section_key, deleted_at)
course_designer_plan_section_statuses_stage_not_null n NOT NULL stage
course_designer_plan_section_statuses_status_not_null n NOT NULL status
course_designer_plan_section_statuses_updated_at_not_null n NOT NULL updated_at
course_designer_plan_section_statuses_updated_by_user_id_fkey FOREIGN KEY FOREIGN KEY (updated_by_user_id) REFERENCES users(id)

Indexes

Name Definition
course_designer_plan_section_statuses_pkey CREATE UNIQUE INDEX course_designer_plan_section_statuses_pkey ON public.course_designer_plan_section_statuses USING btree (id)
course_designer_plan_section_statuses_section_unique CREATE UNIQUE INDEX course_designer_plan_section_statuses_section_unique ON public.course_designer_plan_section_statuses USING btree (course_designer_plan_id, stage, section_key, deleted_at) NULLS NOT DISTINCT

Triggers

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

Relations

er

Generated by tbls