Index

public.chatbot_action_logs

Description

Audit trail of privileged mutations a support chatbot admin confirmed and the server executed. Distinct from any per-domain log (e.g. exercise_reset_logs): this answers “what did admins do via chatbots”, the domain log answers “what happened to this row”.

Columns

Name Type Default Nullable Children Parents Comment
acting_user_id uuid false public.users The admin who confirmed the action.
arguments jsonb false The tool call arguments the model supplied. Must never contain secrets: record what was done, not tokens or links produced by doing it.
course_id uuid true public.courses The course the action was scoped to, if any.
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.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
summary text false One human-readable sentence describing what the action did. Must never contain secrets.
target_user_id uuid true public.users The user the action affected, if any.
tool_call_id uuid false public.chatbot_conversation_message_tool_calls The confirmed tool call that produced this action.
tool_name varchar(255) false Wire name of the action tool that was executed.
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
chatbot_action_logs_acting_user_id_fkey FOREIGN KEY FOREIGN KEY (acting_user_id) REFERENCES users(id)
chatbot_action_logs_acting_user_id_not_null n NOT NULL acting_user_id
chatbot_action_logs_arguments_not_null n NOT NULL arguments
chatbot_action_logs_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
chatbot_action_logs_created_at_not_null n NOT NULL created_at
chatbot_action_logs_id_not_null n NOT NULL id
chatbot_action_logs_pkey PRIMARY KEY PRIMARY KEY (id)
chatbot_action_logs_summary_not_null n NOT NULL summary
chatbot_action_logs_target_user_id_fkey FOREIGN KEY FOREIGN KEY (target_user_id) REFERENCES users(id)
chatbot_action_logs_tool_call_id_fkey FOREIGN KEY FOREIGN KEY (tool_call_id) REFERENCES chatbot_conversation_message_tool_calls(id)
chatbot_action_logs_tool_call_id_not_null n NOT NULL tool_call_id
chatbot_action_logs_tool_name_not_null n NOT NULL tool_name
chatbot_action_logs_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
chatbot_action_logs_acting_user CREATE INDEX chatbot_action_logs_acting_user ON public.chatbot_action_logs USING btree (acting_user_id) WHERE (deleted_at IS NULL)
chatbot_action_logs_pkey CREATE UNIQUE INDEX chatbot_action_logs_pkey ON public.chatbot_action_logs USING btree (id)
chatbot_action_logs_target_user CREATE INDEX chatbot_action_logs_target_user ON public.chatbot_action_logs USING btree (target_user_id) WHERE (deleted_at IS NULL)

Triggers

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

Relations

er

Generated by tbls