Expand description
Database schema and migrations
TRACES: UR-002 | DR-012 | IR-013
ConstantsΒ§
- MIGRATIONS
- List of migrations to apply in order. Each migration is a tuple of (name, sql).
- MIGRATION_
001 π - Initial schema migration
- MIGRATION_
002 π - Migration to remove access_token column from users table Tokens are now stored in the system keyring (or encrypted file fallback)
- MIGRATION_
003 π - Migration to relax foreign key constraints on user_data table Allows tracking playback progress for items not yet synced to local database
- MIGRATION_
004 π - Migration to enhance downloads table with priority and bytes_downloaded
- MIGRATION_
005 π - Migration to relax foreign key constraint on downloads.item_id Allows downloading items that havenβt been synced to local database yet
- MIGRATION_
006 π - Migration to store item metadata directly in downloads table This eliminates dependency on items table being synced and fixes UUID display issues
- MIGRATION_
007 π - Migration to enhance thumbnail caching with LRU eviction support
- MIGRATION_
008 π - Migration to add video download support and item pinning
- MIGRATION_
009 π - Migration to add people/cast caching support
- MIGRATION_
010 π - Migration to add playback context tracking
- MIGRATION_
011 π - Migration to add user-specific player settings
- MIGRATION_
012 π - Migration to track download source (user-initiated vs auto-cached)
- MIGRATION_
013 π - Migration to add composite index for offline mode filtering
- MIGRATION_
014 π - Migration to add series audio track preferences
- MIGRATION_
015 π - Migration to add device ID storage
- MIGRATION_
016 π - Migration to add autoplay episode limit setting
- MIGRATION_
017 π - Migration to persist the resolved stream URL and target directory on each download row. This lets the backend queue pump start a pending download by itself (replaying the stored URL) once a concurrency slot frees up, instead of relying on the frontend to re-issue every queued item.
- MIGRATION_
018 π - 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. - MIGRATION_
019 π - Migration to cache the full server genre catalog. Previously genres were derived on the fly from cached albums, which meant offline (and the hybrid cache-first race) only ever saw genres for the handful of locally-cached albums β collapsing the variety on the music/TV/movie landing pages. This table stores the complete genre list per library so offline has the real catalog and cache-first routing returns the right thing.
- MIGRATION_
020 π - Migration to index
items.season_id. - MIGRATION_
021 π - Discard and rebuild the FTS index from the
itemstable. - MIGRATION_
022 π - Full-text index over
people, mirroringitems_fts. - MIGRATION_
023 π - Give temporary downloads a life limit.