Heartbeats
Table for recording device heartbeat timestamps to monitor device connectivity
| Column Name | Data Type | Constraints |
|---|---|---|
| id | bigint | NOT NULL |
| created_at | timestamp with time zone | DEFAULT now() NOT NULL |
| timestamp | timestamp with time zone | NOT NULL |
| device_id | bigint | NOT NULL |
Security Policies (RLS)
RLS enabled. Herd scope: Herd from heartbeats.device_id → get_herd_id_by_device_id.
| Operation | has_herd_ability ability key | Other paths |
|---|---|---|
| SELECT | telemetry.read | Owning device API key |
| INSERT | telemetry.write | Owning device API key |
| UPDATE | telemetry.write | Owning device API key |
| DELETE | telemetry.write | Owning device API key |
Platform superadmin: FOR ALL bypass where defined.
analyze_device_heartbeats, analyze_herd_device_heartbeats, and get_herd_uptime_summary require telemetry.read in the herd (or the device's own key for analyze_device_heartbeats), platform superadmin, or the service role.