diff --git a/migrations/0014_add_chat_message.sql b/migrations/0014_add_chat_message.sql new file mode 100644 index 0000000..112d279 --- /dev/null +++ b/migrations/0014_add_chat_message.sql @@ -0,0 +1,14 @@ +-- Migration: 0014_add_chat_message +-- Adds the chat_message table used by ChatDO for encrypted message persistence. +-- Content is encrypted with AES-256-GCM before storage (via ChatDO._persist_message). + +CREATE TABLE IF NOT EXISTS chat_message ( + id TEXT PRIMARY KEY, + classroom_id TEXT NOT NULL, + user_id TEXT NOT NULL, + display_name TEXT, + content TEXT NOT NULL, + created_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +CREATE INDEX IF NOT EXISTS idx_chat_created ON chat_message(classroom_id, created_at); diff --git a/public/classroom_poc.html b/public/classroom_poc.html index f29c021..b6c4889 100644 --- a/public/classroom_poc.html +++ b/public/classroom_poc.html @@ -167,7 +167,7 @@