8 lines
462 B
SQL
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));
|