2024-09-11 13:21:05 +00:00
|
|
|
|
2024-06-28 17:05:32 +00:00
|
|
|
CREATE TABLE users (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
username TEXT NOT NULL UNIQUE,
|
|
|
|
password TEXT NOT NULL
|
|
|
|
);
|
2024-09-07 18:49:50 +00:00
|
|
|
CREATE TABLE users_meta (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
user_id INTEGER NOT NULL,
|
|
|
|
name TEXT,
|
|
|
|
email TEXT,
|
2024-09-13 10:04:15 +00:00
|
|
|
timezone TEXT,
|
2024-09-07 18:49:50 +00:00
|
|
|
avatar TEXT,
|
2024-09-11 13:21:05 +00:00
|
|
|
bio TEXT,
|
|
|
|
FOREIGN KEY (user_id) REFERENCES users(id)
|
2024-09-07 18:49:50 +00:00
|
|
|
);
|
|
|
|
CREATE TABLE users_rights (
|
2024-09-11 13:21:05 +00:00
|
|
|
user_id INTEGER,
|
|
|
|
right_id INTEGER,
|
|
|
|
PRIMARY KEY (user_id, right_id),
|
|
|
|
FOREIGN KEY (user_id) REFERENCES users(id),
|
|
|
|
FOREIGN KEY (right_id) REFERENCES rights(id)
|
|
|
|
);
|
|
|
|
CREATE TABLE rights (
|
2024-09-07 18:49:50 +00:00
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
2024-09-12 09:34:22 +00:00
|
|
|
name TEXT NOT NULL UNIQUE
|
2024-09-07 18:49:50 +00:00
|
|
|
);
|
2024-09-04 09:53:02 +00:00
|
|
|
CREATE TABLE platforms (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
name TEXT NOT NULL UNIQUE,
|
|
|
|
jitsi_url TEXT NOT NULL,
|
|
|
|
jilo_database TEXT NOT NULL
|
|
|
|
);
|
|
|
|
CREATE TABLE jilo_agents (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
platform_id INTEGER NOT NULL,
|
2024-09-18 08:32:24 +00:00
|
|
|
agent_type_id INTEGER NOT NULL,
|
2024-09-04 09:53:02 +00:00
|
|
|
url TEXT NOT NULL,
|
2024-09-11 13:21:05 +00:00
|
|
|
secret_key TEXT,
|
2024-10-15 17:48:59 +00:00
|
|
|
check_period INTEGER DEFAULT 0,
|
2024-09-18 08:32:24 +00:00
|
|
|
FOREIGN KEY (platform_id) REFERENCES platforms(id),
|
|
|
|
FOREIGN KEY (agent_type_id) REFERENCES jilo_agent_types(id)
|
2024-09-04 09:53:02 +00:00
|
|
|
);
|
|
|
|
CREATE TABLE jilo_agent_types (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
description TEXT,
|
2024-09-30 08:55:23 +00:00
|
|
|
endpoint TEXT
|
2024-09-04 09:53:02 +00:00
|
|
|
);
|
2024-10-15 17:52:16 +00:00
|
|
|
CREATE TABLE jilo_agent_checks (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
agent_id INTEGER,
|
|
|
|
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
status_code INTEGER,
|
|
|
|
response_time_ms INTEGER,
|
|
|
|
response_content TEXT,
|
|
|
|
FOREIGN KEY (agent_id) REFERENCES jilo_agents(id)
|
|
|
|
);
|
2024-09-16 14:09:37 +00:00
|
|
|
CREATE TABLE logs (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
user_id INTEGET NOT NULL,
|
|
|
|
time TEXT DEFAULT (DATETIME('now')),
|
|
|
|
scope TEXT NOT NULL,
|
|
|
|
message TEXT NOT NULL,
|
|
|
|
FOREIGN KEY (user_id) REFERENCES users(id)
|
|
|
|
);
|