Index

public.chatbot_conversation_messages

Description

The messages in a conversation between a student and a chatbot.

Columns

Name Type Default Nullable Children Parents Comment
conversation_id uuid false public.chatbot_conversations The conversation this message belongs to.
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 public.chatbot_conversation_message_messages public.chatbot_conversation_message_reasoning public.chatbot_conversation_message_tool_calls public.chatbot_conversation_message_tool_outputs public.chatbot_conversation_messages_citations public.chatbot_conversation_suggested_messages A unique, stable identifier for the record.
order_number integer false The order of the message in the conversation.
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_conversation_messages_conversation_id_fkey FOREIGN KEY FOREIGN KEY (conversation_id) REFERENCES chatbot_conversations(id)
chatbot_conversation_messages_conversation_id_not_null n NOT NULL conversation_id
chatbot_conversation_messages_conversation_id_order_number__key UNIQUE UNIQUE NULLS NOT DISTINCT (conversation_id, order_number, deleted_at)
chatbot_conversation_messages_created_at_not_null n NOT NULL created_at
chatbot_conversation_messages_id_not_null n NOT NULL id
chatbot_conversation_messages_order_number_not_null n NOT NULL order_number
chatbot_conversation_messages_pkey PRIMARY KEY PRIMARY KEY (id)
chatbot_conversation_messages_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
chatbot_conversation_messages_conversation_id_order_number__key CREATE UNIQUE INDEX chatbot_conversation_messages_conversation_id_order_number__key ON public.chatbot_conversation_messages USING btree (conversation_id, order_number, deleted_at) NULLS NOT DISTINCT
chatbot_conversation_messages_pkey CREATE UNIQUE INDEX chatbot_conversation_messages_pkey ON public.chatbot_conversation_messages USING btree (id)

Triggers

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

Relations

er

Generated by tbls