CREATE TABLE code_maps ( repo_id TEXT NOT NULL REFERENCES repos(id) ON DELETE CASCADE, commit_sha TEXT NOT NULL, version INTEGER NOT NULL, status TEXT NOT NULL CHECK (status IN ('building', 'ready', 'empty', 'too_large', 'failed')), graph BLOB, files INTEGER NOT NULL DEFAULT 0, symbols INTEGER NOT NULL DEFAULT 0, started_at INTEGER NOT NULL, built_at INTEGER, PRIMARY KEY (repo_id, commit_sha) );