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 everyCodeit seeds in a run (seedProfilewrapper around the existingseedMediaProfile) and calls the newpruneObsoleteMediaProfiles(db, seededCodes)at the end — hard-deletes (Unscoped()) anyTranscodingProfilewith a non-nullCodenot in that list. Non-nullCodeis 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 nextAutoMigraterecreates them fresh instead of altering. Wired intomain.go, gated behindMEDIA_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.