feat(db): flag episodes that vanish upstream

This commit is contained in:
Miguel Palhas
2026-08-23 17:59:41 +01:00
parent 384e260d72
commit 3bcc612f9a
@@ -0,0 +1,7 @@
-- #122. TMDB deletes and renumbers episodes. An episode that vanished
-- upstream and has no file is deleted outright by the refresh; one that has
-- a file is never deleted — `media_files.path` is UNIQUE and its owner is
-- polymorphic, so dropping the row would orphan a real file — and instead
-- carries this flag as the conflict the operator resolves.
ALTER TABLE episodes ADD COLUMN vanished INTEGER NOT NULL DEFAULT 0
CHECK (vanished IN (0, 1));