jarvis/schema.sql

15 lines
414 B
MySQL
Raw Normal View History

2024-10-06 21:23:55 -04:00
CREATE TABLE IF NOT EXISTS Keys (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT NOT NULL UNIQUE,
api_key TEXT NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS Queries (
2024-10-06 21:43:49 -04:00
id TEXT PRIMARY KEY,
2024-10-06 21:23:55 -04:00
ip TEXT NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
query TEXT NOT NULL,
api_key_id INTEGER,
conversation_history TEXT,
FOREIGN KEY (api_key_id) REFERENCES Keys (id)
);