From 41ebba39637af4e7f5a6bd701ef6e579eb79a9ca Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 2 Oct 2026 08:51:11 +0200 Subject: [PATCH] feat(store): migration 020 -- uploaded_transcripts.progress, progress_at, alive_at (ADR-035) Co-Authored-By: Claude Sonnet 5.5 --- .../020_uploaded_transcripts_progress.down.sql | 4 ++++ .../020_uploaded_transcripts_progress.up.sql | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 internal/adapters/store/migrations/020_uploaded_transcripts_progress.down.sql create mode 100644 internal/adapters/store/migrations/020_uploaded_transcripts_progress.up.sql diff --git a/internal/adapters/store/migrations/020_uploaded_transcripts_progress.down.sql b/internal/adapters/store/migrations/020_uploaded_transcripts_progress.down.sql new file mode 100644 index 0000000..f80bcd2 --- /dev/null +++ b/internal/adapters/store/migrations/020_uploaded_transcripts_progress.down.sql @@ -0,0 +1,4 @@ +ALTER TABLE uploaded_transcripts + DROP COLUMN alive_at, + DROP COLUMN progress_at, + DROP COLUMN progress; diff --git a/internal/adapters/store/migrations/020_uploaded_transcripts_progress.up.sql b/internal/adapters/store/migrations/020_uploaded_transcripts_progress.up.sql new file mode 100644 index 0000000..40d373e --- /dev/null +++ b/internal/adapters/store/migrations/020_uploaded_transcripts_progress.up.sql @@ -0,0 +1,15 @@ +-- Migration 020: where an upload job is, and whether the service is still reporting (ADR-035). +-- +-- progress the job's ordered phases as JSON (key, label, state, times, done/total). +-- progress_at when a phase last REALLY changed or advanced. +-- alive_at a heartbeat stamped every few seconds by a goroutine independent of any +-- engine call. The two differ on purpose: alive says the service is still +-- reporting, progress says work is moving, and a page that cannot tell a +-- crashed service from a slow model is the failure this exists to end. +-- +-- All three are NULL until the job starts. They sit on the already-FORCE'd, RLS-scoped +-- uploaded_transcripts, so the exact-set isolation test is unaffected. +ALTER TABLE uploaded_transcripts + ADD COLUMN progress JSONB, + ADD COLUMN progress_at TIMESTAMPTZ, + ADD COLUMN alive_at TIMESTAMPTZ;