Files
arr/crates/arr-db/migrations/0019_vanished_episodes.sql
T
2026-08-23 17:59:41 +01:00

8 lines
462 B
SQL

-- #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));