fix(phase26): server trip delete persists across recompute + batch delete with checkboxes

This commit is contained in:
Mathieu Moran
2026-08-11 04:18:58 -04:00
parent e6bc488e84
commit bdc7a9afb7
6 changed files with 133 additions and 5 deletions
@@ -0,0 +1,10 @@
-- Migration: deleted trip markers to prevent recompute from re-inserting
-- manually deleted trips. Each row records a trip the user explicitly
-- removed. compute_trips_for_device() skips time ranges matching any marker.
-- The "Recompute trips" button clears all markers before rebuilding.
CREATE TABLE IF NOT EXISTS deleted_trip_markers (
device_id INTEGER NOT NULL REFERENCES devices(id) ON DELETE CASCADE,
start_time TIMESTAMPTZ NOT NULL,
deleted_at TIMESTAMPTZ NOT NULL DEFAULT now(),
PRIMARY KEY (device_id, start_time)
);