-- Add thumbnail path column for cached locally-served thumbnails.
-- Generated by Pillow at download time (320×240 cover, WebP q=70).
-- Idempotent.

ALTER TABLE domrf_kn_photos
    ADD COLUMN IF NOT EXISTS thumb_path TEXT;

CREATE INDEX IF NOT EXISTS idx_kn_photos_obj_visible
    ON domrf_kn_photos (obj_id)
    WHERE COALESCE(hidden, FALSE) = FALSE;
