Skip to main content

## MIGRATION_020

# Constant MIGRATION_020

Source

    const MIGRATION_020: &str = r#"
    CREATE INDEX IF NOT EXISTS idx_items_season ON items(season_id);
    "#;

Expand description

Migration to index `items.season_id`.

Episodes link to their season via `season_id` (parent_id is NULL in the cache). The container-rollup queries used by the Downloaded browse and the disk-usage aggregation join `children.season_id = c.id`, which without this index degrades to an unindexable scan — a large synced catalog then makes the Downloaded page hang (“Loading your downloads…”). `parent_id`, `album_id`, and `series_id` were already indexed; this closes the gap.