Vellum/migrations
mithral c247539ac0 Add the subtitle schema
Vellum had no subtitle support of any kind. This is the storage half.

Three sources, and they are genuinely different shapes: a sidecar file beside
the video has a path, an embedded stream has an index into the container and
no file of its own, and a downloaded track has a path but is regenerable.

stream_index is -1 for the file-backed sources rather than NULL, and that is
deliberate: NULL is never equal to NULL in SQL, so a unique index over a
nullable column would happily accept the same sidecar twice. With -1 the
UNIQUE (item_id, source, path, stream_index) actually does its job and a
rescan can upsert.

Nothing here is authoritative about the media. Deleting every row and
rescanning reproduces it exactly, which is what lets a vanished subtitle file
have its row removed - unlike a vanished video, which is marked instead
(ADR-003) because progress hangs off it and cannot be regenerated.

Verified on both paths: a real database at version 13 upgraded to 14 by an
older binary-then-newer sequence, and a fresh database applied 0001..0014.
2026-10-12 11:33:18 -04:00
..
0001_core.sql Phase 0: skeleton, config, migrations, health check, container 2026-10-09 16:26:08 -04:00
0002_missing.sql Phase 2: libraries and the file scanner 2026-10-09 16:33:56 -04:00
0003_search.sql Phase 2b: FTS5 search 2026-10-09 21:10:44 -04:00
0004_metadata.sql Phase 5: job queue and metadata providers 2026-10-09 21:16:07 -04:00
0005_games.sql Phase 7: games — ROM scanning, platforms, cloud saves, EmulatorJS 2026-10-09 21:54:49 -04:00
0006_views.sql Home: five sections — Continue, Most Viewed, Suggestions, Recently Added, Explore 2026-10-10 16:59:39 -04:00
0007_job_ref.sql Beta blockers: async scans, admin CLI, deploy docs, pagination, password UI 2026-10-10 18:00:35 -04:00
0008_query_indexes.sql Wave 1: survive a real library 2026-10-11 13:10:34 -04:00
0009_search_authors.sql Wave 3: search depth, transfer size, and the Home screen's tests 2026-10-11 13:46:18 -04:00
0010_media_probe.sql Waves 4-6: audio depth, ffprobe facts, and direct-play video 2026-10-11 14:14:32 -04:00
0011_missing_since.sql Waves 7-8: playback engine selection, and missing files you can see 2026-10-11 14:36:55 -04:00
0012_api_tokens.sql Waves 9-10: Jellyfin and Subsonic clients can browse and play 2026-10-11 15:05:43 -04:00
0013_series.sql Add the television schema: seasons and episodes 2026-10-12 01:19:06 -04:00
0014_subtitles.sql Add the subtitle schema 2026-10-12 11:33:18 -04:00
embed.go Phase 0: skeleton, config, migrations, health check, container 2026-10-09 16:26:08 -04:00