feat: store chat_id to allow multiple chats, use enums in tauri

communication
This commit is contained in:
2026-02-22 11:52:42 +02:00
parent edc425e28f
commit 6364fdf1cd
11 changed files with 129 additions and 59 deletions

View File

@@ -1,5 +0,0 @@
CREATE TABLE IF NOT EXISTS messages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
text TEXT NOT NULL,
is_user BOOL NOT NULL
);

View File

@@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS messages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
chat_id INTEGER NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
text TEXT NOT NULL,
is_user BOOL NOT NULL,
UNIQUE(id, chat_id)
);
CREATE INDEX idx_message_timestamp ON messages(timestamp);
CREATE INDEX idx_message_chat_id ON messages(chat_id);