Index unsynced caption frames

This commit is contained in:
Sleeps
2026-10-07 14:26:37 +01:00
parent a866ac80bb
commit 3e1eb9addd
+7
View File
@@ -115,6 +115,13 @@ def _ensure_frame_caption_columns(con: sqlite3.Connection) -> None:
for name, sql_type in additions.items(): for name, sql_type in additions.items():
if name not in columns: if name not in columns:
con.execute(f"ALTER TABLE frames ADD COLUMN {name} {sql_type}") con.execute(f"ALTER TABLE frames ADD COLUMN {name} {sql_type}")
con.execute(
"""
CREATE INDEX IF NOT EXISTS idx_frames_unsynced_caption
ON frames(meili_synced_at)
WHERE caption IS NOT NULL
"""
)
def init_db(path: Path) -> None: def init_db(path: Path) -> None: