feat: persist chat messages to SQLite (#1)
All checks were successful
Deploy c4 / deploy (push) Successful in 44s

This commit was merged in pull request #1.
This commit is contained in:
2026-02-13 22:00:01 +00:00
parent 08c20a1732
commit 3593197271
6 changed files with 150 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
-- +goose Up
CREATE TABLE chat_messages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
game_id TEXT NOT NULL,
nickname TEXT NOT NULL,
color INTEGER NOT NULL,
message TEXT NOT NULL,
created_at INTEGER NOT NULL,
FOREIGN KEY (game_id) REFERENCES games(id) ON DELETE CASCADE
);
CREATE INDEX idx_chat_messages_game ON chat_messages(game_id, created_at);
-- +goose Down
DROP INDEX IF EXISTS idx_chat_messages_game;
DROP TABLE IF EXISTS chat_messages;