mirror of
https://github.com/lorsanstand/HomeOps-Hub.git
synced 2026-06-19 16:45:15 +03:00
feat: new table heartbeats
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
DROP INDEX idx_heartbeat_agent_id;
|
||||
|
||||
DROP TABLE if exists heartbeats;
|
||||
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE heartbeats (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
agent_id VARCHAR(32) UNIQUE NOT NULL,
|
||||
cpu_usage FLOAT,
|
||||
memory_usage FLOAT,
|
||||
disk_usage FLOAT,
|
||||
heartbeat_timestamp TIMESTAMP
|
||||
FOREIGN KEY (agent_id) REFERENCES agents(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX idx_heartbeat_agent_id ON heartbeats (agent_id);
|
||||
Reference in New Issue
Block a user