Add alerts when devices reconnect after stopping

This commit is contained in:
2025-10-20 19:08:21 -04:00
parent 98fa161eb1
commit 2f25286c21
10 changed files with 73 additions and 22 deletions

View File

@@ -1,11 +1,16 @@
INSERT INTO device(
name,
last_updated
last_updated,
stopped_reporting
)
VALUES (
@Name,
@LastUpdated
@LastUpdated,
false
)
ON CONFLICT (name)
DO UPDATE
SET last_updated = EXCLUDED.last_updated
SET last_updated = EXCLUDED.last_updated,
stopped_reporting = false
RETURNING
(SELECT stopped_reporting FROM device WHERE name = @Name);