-- Ported from the SQLite migration of the same number. -- The Slurm jobs that ended, each recorded once (job_key is the cluster's -- name and the job's id), with what it used and cost; a usage row (model -- "slurm") carries the cost into the usage pages with the requests'. CREATE TABLE slurm_jobs ( job_key TEXT PRIMARY KEY, user_id TEXT NOT NULL DEFAULT '', project_id TEXT NOT NULL DEFAULT '', login TEXT NOT NULL DEFAULT '', account TEXT NOT NULL DEFAULT '', partition TEXT NOT NULL DEFAULT '', state TEXT NOT NULL DEFAULT '', started_at BIGINT NOT NULL DEFAULT 0, ended_at BIGINT NOT NULL DEFAULT 0, elapsed_seconds BIGINT NOT NULL DEFAULT 0, cpus BIGINT NOT NULL DEFAULT 0, gpus BIGINT NOT NULL DEFAULT 0, cost_micros BIGINT NOT NULL DEFAULT 0 ); CREATE INDEX slurm_jobs_by_project ON slurm_jobs(project_id, ended_at);