Skip to content

Changelog


2026-08-04

Media transcoding profile seed — prune obsolete Codes, plus a companion hard-reset tool

Why: the media domain's table shapes and seed values are still changing frequently pre-launch. seedMediaProfile already converged an existing seed row's content to the file on every boot (2026-08-03), but had no way to actually remove a row whose Code was deleted or renamed from the file entirely — it just stayed stranded in the DB forever. Separately, some changes aren't seed-value changes at all but real column/type changes, which AutoMigrate can add but never safely retrofits onto existing data.

What changed:

  • seedMediaTranscodingProfiles (pkg/seed/mediatranscoding_presets.go) now tracks every Code it seeds in a run (seedProfile wrapper around the existing seedMediaProfile) and calls the new pruneObsoleteMediaProfiles(db, seededCodes) at the end — hard-deletes (Unscoped()) any TranscodingProfile with a non-null Code not in that list. Non-null Code is what scopes this to seed-managed rows only; CRUD-created profiles never set one. See pkg/seed § Pruning for the production-safety caveat this introduces (pruning is unconditional, not gated behind any flag).
  • New db.HardResetTables(tables ...string) error (pkg/db/migrate.go) — drops the given tables (CASCADE) so the next AutoMigrate recreates them fresh instead of altering. Wired into main.go, gated behind MEDIA_HARD_RESET=true, scoped to exactly 7 media-domain tables (media, upload_tokens, transcoding_profiles, transcoding_profile_versions, media_playlists, media_playlist_items, media_slides). Off by default — no effect on any environment that doesn't set the var. See Migrations § Hard-resetting a domain.