generated from CubeCraft-Creations/Tracehound
fix: hub-side dedup for ESP32 offline status replay (CUB-239)
- Add migration 002: UNIQUE index on status_logs(camera_id, recorded_at) - Upgrade migration system to version-tracked (schema_version table) - Prevents race-condition double-inserts that application-level COUNT(*) check cannot guard against - Complements existing application-level dedup from CUB-230
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- Migration: 002_dedup_unique_index
|
||||
-- Add a UNIQUE index on (camera_id, recorded_at) to enforce hub-side
|
||||
-- deduplication for ESP32 offline status replay (CUB-239).
|
||||
-- This prevents race-condition double-inserts that a pure SELECT COUNT(*)
|
||||
-- check cannot guard against.
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_status_logs_unique_entry
|
||||
ON status_logs(camera_id, recorded_at);
|
||||
Reference in New Issue
Block a user