-- Rich per-node metrics tapped from the workspace's Beszel hub (beyond the basic -- heartbeat health). One latest snapshot per node: queryable scalar columns drive -- the fleet card widgets + the rules engine; the JSONB `data` holds the full -- snapshot (per-core CPU, per-GPU, per-interface network, per-container) for the -- per-node monitor page. History for charts is proxied live from the hub. CREATE TABLE node_metrics ( node_id UUID PRIMARY KEY REFERENCES nodes (id) ON DELETE CASCADE, updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), cpu_pct DOUBLE PRECISION, mem_pct DOUBLE PRECISION, disk_pct DOUBLE PRECISION, gpu_pct DOUBLE PRECISION, temp_max DOUBLE PRECISION, net_sent_ps BIGINT, net_recv_ps BIGINT, disk_read_ps BIGINT, disk_write_ps BIGINT, load1 DOUBLE PRECISION, container_count INTEGER, data JSONB NOT NULL DEFAULT '{}'::jsonb );