feat: store chat_id to allow multiple chats, use enums in tauri
communication
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS messages (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
text TEXT NOT NULL,
|
||||
is_user BOOL NOT NULL
|
||||
);
|
||||
12
crates/daemon/migrations/20260222_1_init.sql
Normal file
12
crates/daemon/migrations/20260222_1_init.sql
Normal 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);
|
||||
Reference in New Issue
Block a user