Index

public.exercise_answer_snapshot_files

Description

The uploaded files a snapshot consists of. The answer-upload reaper spares any upload a live row here references.

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.
exercise_answer_snapshot_id uuid false public.exercise_answer_snapshots The snapshot these files belong to.
file_upload_id uuid false public.file_uploads The uploaded file.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
order_number integer false The order the client named the files in.
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
exercise_answer_snapshot_fi_exercise_answer_snapshot_i_not_null n NOT NULL exercise_answer_snapshot_id
exercise_answer_snapshot_files_created_at_not_null n NOT NULL created_at
exercise_answer_snapshot_files_exercise_answer_snapshot_id_fkey FOREIGN KEY FOREIGN KEY (exercise_answer_snapshot_id) REFERENCES exercise_answer_snapshots(id)
exercise_answer_snapshot_files_file_upload_id_fkey FOREIGN KEY FOREIGN KEY (file_upload_id) REFERENCES file_uploads(id)
exercise_answer_snapshot_files_file_upload_id_not_null n NOT NULL file_upload_id
exercise_answer_snapshot_files_id_not_null n NOT NULL id
exercise_answer_snapshot_files_order_number_not_null n NOT NULL order_number
exercise_answer_snapshot_files_pkey PRIMARY KEY PRIMARY KEY (id)
exercise_answer_snapshot_files_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
exercise_answer_snapshot_files_pkey CREATE UNIQUE INDEX exercise_answer_snapshot_files_pkey ON public.exercise_answer_snapshot_files USING btree (id)
idx_exercise_answer_snapshot_files_file CREATE INDEX idx_exercise_answer_snapshot_files_file ON public.exercise_answer_snapshot_files USING btree (file_upload_id) WHERE (deleted_at IS NULL)
idx_exercise_answer_snapshot_files_snapshot CREATE INDEX idx_exercise_answer_snapshot_files_snapshot ON public.exercise_answer_snapshot_files USING btree (exercise_answer_snapshot_id) WHERE (deleted_at IS NULL)

Triggers

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

Relations

er

Generated by tbls