-- 0007_job_ref.sql — let a job be found by what it operates on. -- -- Scans need their progress read back: the UI asks "what is the state of the -- scan for library 3?" That requires the job to carry the id it refers to and -- to store its result, neither of which the queue had. ALTER TABLE jobs ADD COLUMN ref_id INTEGER; ALTER TABLE jobs ADD COLUMN result TEXT NOT NULL DEFAULT ''; CREATE INDEX idx_jobs_kind_ref ON jobs(kind, ref_id, id);