From 0dc74daf1b798849c683d379bd421c0c5eb2565e Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 25 Mar 2026 08:21:40 -0700 Subject: [PATCH] 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) --- supabase/migrations/003_source_and_guards.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supabase/migrations/003_source_and_guards.sql b/supabase/migrations/003_source_and_guards.sql index 06bdbdf6..230ce848 100644 --- a/supabase/migrations/003_source_and_guards.sql +++ b/supabase/migrations/003_source_and_guards.sql @@ -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';