Skip to main content

MIGRATION_018

Constant MIGRATION_018 

Source
const MIGRATION_018: &str = r#"
ALTER TABLE items ADD COLUMN is_folder INTEGER DEFAULT 0;

-- Force re-fetch of all cached items so is_folder is populated from the server.
UPDATE items SET synced_at = NULL;
"#;
Expand description

Migration to record whether a cached item is a folder/container vs a playable leaf. Needed so channel items (which can be either) route to the player or to a browse list correctly. Existing cached rows predate the column and have an unknown folder flag, so we force a refresh by clearing their synced_at, causing the hybrid repository to re-fetch them from the server on next browse.