Index

public.rejected_exercise_task_submission_files

Description

The files a rejected file answer named. Deliberately not consulted by the exercise_answer_uploads reaper: a rejected submission is one the student still has to redo, so its uploads stay orphaned and the objects are deleted at the end of the retention window. What survives is the audit trail – these rows plus the file_uploads and exercise_answer_uploads rows they point at, which are only ever soft-deleted, so a rejection can still be diagnosed down to the name, type and size of every file it named.

Columns

Name Type Default Nullable Children Parents Comment
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.
file_upload_id uuid false public.file_uploads The uploaded file. The stored object is usually gone by the time anyone reads this row.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
order_number integer false The order the client sent the files in, preserved because it is part of a file answer.
rejected_exercise_task_submission_id uuid false public.rejected_exercise_task_submissions The rejected task submission that named these files.
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
rejected_exercise_task_subm_rejected_exercise_task_sub_not_null n NOT NULL rejected_exercise_task_submission_id
rejected_exercise_task_submis_rejected_exercise_task_submi_fkey FOREIGN KEY FOREIGN KEY (rejected_exercise_task_submission_id) REFERENCES rejected_exercise_task_submissions(id)
rejected_exercise_task_submission_files_created_at_not_null n NOT NULL created_at
rejected_exercise_task_submission_files_file_upload_id_fkey FOREIGN KEY FOREIGN KEY (file_upload_id) REFERENCES file_uploads(id)
rejected_exercise_task_submission_files_file_upload_id_not_null n NOT NULL file_upload_id
rejected_exercise_task_submission_files_id_not_null n NOT NULL id
rejected_exercise_task_submission_files_order_number_not_null n NOT NULL order_number
rejected_exercise_task_submission_files_pkey PRIMARY KEY PRIMARY KEY (id)
rejected_exercise_task_submission_files_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
idx_rejected_exercise_task_submission_files_submission CREATE INDEX idx_rejected_exercise_task_submission_files_submission ON public.rejected_exercise_task_submission_files USING btree (rejected_exercise_task_submission_id) WHERE (deleted_at IS NULL)
rejected_exercise_task_submission_files_pkey CREATE UNIQUE INDEX rejected_exercise_task_submission_files_pkey ON public.rejected_exercise_task_submission_files USING btree (id)

Triggers

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

Relations

er

Generated by tbls