fix: inline Phase 4A cleanup in migration 003

The duration_reasonable CHECK constraint fails on existing rows with
56-year durations from the shell var bug. Move the prerequisite
UPDATE into the migration itself so it's self-contained.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-25 08:21:40 -07:00
parent 539a6600cd
commit 0dc74daf1b
@@ -1,8 +1,8 @@
-- gstack telemetry data integrity + growth metrics
-- Adds source tagging, install fingerprinting, duration guards, and growth views.
--
-- PREREQUISITE: Run Phase 4A cleanup BEFORE this migration:
-- UPDATE telemetry_events SET duration_s = NULL WHERE duration_s > 86400 OR duration_s < 0;
-- ─── Phase 4A cleanup (inline — fixes 56-year durations from shell var bug) ──
UPDATE telemetry_events SET duration_s = NULL WHERE duration_s > 86400 OR duration_s < 0;
-- ─── Source field (live/test/dev tagging) ─────────────────────
ALTER TABLE telemetry_events ADD COLUMN source TEXT DEFAULT 'live';