Stores logs of exercise resets, tracking who reset which exercises for whom and when.
| 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. |
| Name | Type | Definition |
|---|---|---|
| exercise_reset_logs_course_id_fkey | FOREIGN KEY | FOREIGN KEY (course_id) REFERENCES courses(id) |
| exercise_reset_logs_course_id_not_null | n | NOT NULL course_id |
| exercise_reset_logs_created_at_not_null | n | NOT NULL created_at |
| exercise_reset_logs_exercise_id_fkey | FOREIGN KEY | FOREIGN KEY (exercise_id) REFERENCES exercises(id) |
| exercise_reset_logs_exercise_id_not_null | n | NOT NULL exercise_id |
| exercise_reset_logs_id_not_null | n | NOT NULL id |
| exercise_reset_logs_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| exercise_reset_logs_reset_at_not_null | n | NOT NULL reset_at |
| exercise_reset_logs_reset_by_fkey | FOREIGN KEY | FOREIGN KEY (reset_by) REFERENCES users(id) |
| exercise_reset_logs_reset_by_not_null | n | NOT NULL reset_by |
| exercise_reset_logs_reset_for_fkey | FOREIGN KEY | FOREIGN KEY (reset_for) REFERENCES users(id) |
| exercise_reset_logs_reset_for_not_null | n | NOT NULL reset_for |
| exercise_reset_logs_updated_at_not_null | n | NOT NULL updated_at |
| Name | Definition |
|---|---|
| exercise_reset_logs_pkey | CREATE UNIQUE INDEX exercise_reset_logs_pkey ON public.exercise_reset_logs USING btree (id) |
| Name | Definition |
|---|---|
| set_timestamp | CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.exercise_reset_logs FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp() |
Generated by tbls