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;