Index

public.exercise_reset_logs

Description

Stores logs of exercise resets, tracking who reset which exercises for whom and when.

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid false public.courses The course for which the reset exercise belongs.
created_at timestamp with time zone now() false Timestamp when the reset log entry was created.
deleted_at timestamp with time zone true Timestamp when the log entry was marked as deleted. If null, the log entry is active.
exercise_id uuid false public.exercises The ID of the exercise that was reset.
id uuid gen_random_uuid() false A unique identifier for the reset log entry.
reset_at timestamp with time zone now() false Timestamp when the reset action was performed. Defaults to the current timestamp.
reset_by uuid false public.users The user who performed the reset.
reset_for uuid false public.users The user whose exercises were reset.
updated_at timestamp with time zone now() false Timestamp when the reset log entry was last updated. This field is automatically updated by the set_timestamp trigger.

Constraints

Name Type Definition
exercise_reset_logs_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
exercise_reset_logs_exercise_id_fkey FOREIGN KEY FOREIGN KEY (exercise_id) REFERENCES exercises(id)
exercise_reset_logs_pkey PRIMARY KEY PRIMARY KEY (id)
exercise_reset_logs_reset_by_fkey FOREIGN KEY FOREIGN KEY (reset_by) REFERENCES users(id)
exercise_reset_logs_reset_for_fkey FOREIGN KEY FOREIGN KEY (reset_for) REFERENCES users(id)

Indexes

Name Definition
exercise_reset_logs_pkey CREATE UNIQUE INDEX exercise_reset_logs_pkey ON public.exercise_reset_logs USING btree (id)

Triggers

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

Relations

er

Generated by tbls