From 0b64054e967d3304267b05af5585725c18d71fdd Mon Sep 17 00:00:00 2001 From: Tayeb Mokni Date: Mon, 25 May 2026 23:49:42 +0200 Subject: [PATCH 1/5] feat(db): add media HLS/text/proxy columns and tables - 000036: media.hls_url for the video transcode pipeline (#52) - 000037: media_text table for PDF text extraction (#60) - 000038: media.is_proxied + media.source_url for migration proxy mode (#187) Co-Authored-By: Claude Opus 4.7 Signed-off-by: Tayeb Mokni --- migrations/000036_media_hls.down.sql | 8 ++++ migrations/000036_media_hls.up.sql | 37 +++++++++++++++ migrations/000037_media_text.down.sql | 5 ++ migrations/000037_media_text.up.sql | 66 ++++++++++++++++++++++++++ migrations/000038_media_proxy.down.sql | 12 +++++ migrations/000038_media_proxy.up.sql | 57 ++++++++++++++++++++++ 6 files changed, 185 insertions(+) create mode 100644 migrations/000036_media_hls.down.sql create mode 100644 migrations/000036_media_hls.up.sql create mode 100644 migrations/000037_media_text.down.sql create mode 100644 migrations/000037_media_text.up.sql create mode 100644 migrations/000038_media_proxy.down.sql create mode 100644 migrations/000038_media_proxy.up.sql diff --git a/migrations/000036_media_hls.down.sql b/migrations/000036_media_hls.down.sql new file mode 100644 index 00000000..473b70bc --- /dev/null +++ b/migrations/000036_media_hls.down.sql @@ -0,0 +1,8 @@ +-- 000036_media_hls.down.sql +-- +-- Reverse of 000036_media_hls.up.sql. Drops the HLS playlist column +-- from the media table. The bytes on disk (m3u8 + segments) are NOT +-- swept by this migration — that's a separate purge cron concern; +-- this only releases the row-side reference. + +ALTER TABLE media DROP COLUMN IF EXISTS hls_url; diff --git a/migrations/000036_media_hls.up.sql b/migrations/000036_media_hls.up.sql new file mode 100644 index 00000000..bb79d043 --- /dev/null +++ b/migrations/000036_media_hls.up.sql @@ -0,0 +1,37 @@ +-- 000036_media_hls.up.sql +-- +-- Adds the HLS playlist URL column to the media table — backs the +-- video transcoding pipeline (issue #52). When the worker's +-- media.video.transcode task lands, it writes the resulting +-- index.m3u8 URL here so the public player can pick HLS over the +-- raw mp4 source. +-- +-- Design notes +-- +-- * NULLABLE on purpose. Every existing video row predates the +-- pipeline and the playlist won't exist for them until an +-- operator triggers a reprocess; nullable means "not yet +-- transcoded" without a sentinel value. New uploads also flow +-- through nullable: the row is committed at upload-time, the +-- HLS URL fills in asynchronously once the worker finishes. +-- +-- * TEXT (not bytea / json) because the URL is exactly what the +--