feat: new table heartbeats

This commit is contained in:
2026-05-06 21:38:58 +03:00
parent ce84c19f90
commit f2d0924bca
2 changed files with 14 additions and 0 deletions
@@ -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);