feat(db): add missing indexes to library migrations
This commit is contained in:
@@ -21,6 +21,7 @@ CREATE TABLE IF NOT EXISTS library_items (
|
|||||||
CREATE INDEX IF NOT EXISTS idx_library_items_provider ON library_items(provider_id);
|
CREATE INDEX IF NOT EXISTS idx_library_items_provider ON library_items(provider_id);
|
||||||
CREATE INDEX IF NOT EXISTS idx_library_items_content_type ON library_items(content_type);
|
CREATE INDEX IF NOT EXISTS idx_library_items_content_type ON library_items(content_type);
|
||||||
CREATE INDEX IF NOT EXISTS idx_library_items_series ON library_items(series_name);
|
CREATE INDEX IF NOT EXISTS idx_library_items_series ON library_items(series_name);
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_library_items_provider_external ON library_items(provider_id, external_id);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS library_sync_log (
|
CREATE TABLE IF NOT EXISTS library_sync_log (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
@@ -31,3 +32,6 @@ CREATE TABLE IF NOT EXISTS library_sync_log (
|
|||||||
status TEXT NOT NULL DEFAULT 'running',
|
status TEXT NOT NULL DEFAULT 'running',
|
||||||
error_msg TEXT
|
error_msg TEXT
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_library_sync_log_provider ON library_sync_log(provider_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_library_sync_log_provider_started ON library_sync_log(provider_id, started_at DESC);
|
||||||
|
|||||||
Reference in New Issue
Block a user