Index

public.cheating_confirmation_grade_snapshots

Description

Pre-confirmation grade snapshots for course module completions, allowing a confirmed cheating suspicion to be undone by restoring the completion’s original passed/grade.

Columns

Name Type Default Nullable Children Parents Comment
course_module_completion_id uuid false public.course_module_completions The completion whose grade was snapshotted before it was failed by a cheating confirmation.
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. Set when the suspicion is dismissed and the snapshot has been restored onto the completion.
grade integer true The value of course_module_completions.grade before the cheating confirmation set it to 0. May be NULL (ungraded pass/fail completion).
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
passed boolean false The value of course_module_completions.passed before the cheating confirmation set it to false.
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.

Constraints

Name Type Definition
cheating_confirmation_grade_course_module_completion_i_not_null n NOT NULL course_module_completion_id
cheating_confirmation_grade_sn_course_module_completion_id_fkey FOREIGN KEY FOREIGN KEY (course_module_completion_id) REFERENCES course_module_completions(id)
cheating_confirmation_grade_snapshots_created_at_not_null n NOT NULL created_at
cheating_confirmation_grade_snapshots_id_not_null n NOT NULL id
cheating_confirmation_grade_snapshots_passed_not_null n NOT NULL passed
cheating_confirmation_grade_snapshots_pkey PRIMARY KEY PRIMARY KEY (id)
cheating_confirmation_grade_snapshots_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
cheating_confirmation_grade_snapshots_completion_uniqueness CREATE UNIQUE INDEX cheating_confirmation_grade_snapshots_completion_uniqueness ON public.cheating_confirmation_grade_snapshots USING btree (course_module_completion_id) WHERE (deleted_at IS NULL)
cheating_confirmation_grade_snapshots_pkey CREATE UNIQUE INDEX cheating_confirmation_grade_snapshots_pkey ON public.cheating_confirmation_grade_snapshots USING btree (id)

Triggers

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

Relations

er

Generated by tbls