modified: bot.db

modified:   db/db.go
	modified:   handlers/dashboard.go
	modified:   main.go
	modified:   services/openrouter.go
	modified:   templates/dashboard.html
This commit is contained in:
2026-03-01 06:34:23 -03:00
parent 39cc33a2ec
commit d4d395356b
7 changed files with 316 additions and 209 deletions

View File

@@ -28,6 +28,20 @@ func Init() {
customer_phone TEXT,
appointment_date TEXT,
status TEXT DEFAULT 'confirmed'
);
CREATE TABLE IF NOT EXISTS chats (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT DEFAULT 'New Chat',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS messages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
chat_id INTEGER,
role TEXT, -- 'user' or 'assistant'
content TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(chat_id) REFERENCES chats(id)
);`
Conn.Exec(schema)
}