diff options
Diffstat (limited to 'src/schema.sql')
-rw-r--r-- | src/schema.sql | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/schema.sql b/src/schema.sql index 65aebbd..eb0f7e9 100644 --- a/src/schema.sql +++ b/src/schema.sql @@ -1,30 +1,40 @@ BEGIN TRANSACTION; CREATE TABLE Specifications ( - repo_name TEXT NOT NULL PRIMARY KEY, + name TEXT NOT NULL PRIMARY KEY, + load_path_inputs TEXT NOT NULL, -- list of input names whose load path will be in Guile's %load-path + package_path_inputs TEXT NOT NULL, -- list of input names whose load paths will be in GUIX_PACKAGE_PATH + proc_input TEXT NOT NULL, -- name of the input containing the proc that does the evaluation + proc_file TEXT NOT NULL, -- file containing the procedure that does the evaluation, relative to proc_input + proc TEXT NOT NULL, -- defined in proc_file + proc_args TEXT NOT NULL -- passed to proc +); + +CREATE TABLE Inputs ( + specification TEXT NOT NULL, + name TEXT NOT NULL, url TEXT NOT NULL, load_path TEXT NOT NULL, - file TEXT NOT NULL, - proc TEXT NOT NULL, - arguments TEXT NOT NULL, -- The following columns are optional. branch TEXT, tag TEXT, revision TEXT, - no_compile_p INTEGER + no_compile_p INTEGER, + PRIMARY KEY (specification, name), + FOREIGN KEY (specification) REFERENCES Specifications (name) ); CREATE TABLE Stamps ( specification TEXT NOT NULL PRIMARY KEY, stamp TEXT NOT NULL, - FOREIGN KEY (specification) REFERENCES Specifications (repo_name) + FOREIGN KEY (specification) REFERENCES Specifications (name) ); CREATE TABLE Evaluations ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, specification TEXT NOT NULL, - revision TEXT NOT NULL, - FOREIGN KEY (specification) REFERENCES Specifications (repo_name) + commits TEXT NOT NULL, + FOREIGN KEY (specification) REFERENCES Specifications (name) ); CREATE TABLE Derivations ( @@ -63,7 +73,7 @@ CREATE TABLE Builds ( -- Create indexes to speed up common queries, in particular those -- corresponding to /api/latestbuilds and /api/queue HTTP requests. CREATE INDEX Builds_Derivations_index ON Builds(status ASC, timestamp ASC, id, derivation, evaluation, stoptime DESC); -CREATE INDEX Specifications_index ON Specifications(repo_name, branch); +CREATE INDEX Inputs_index ON Inputs(specification, name, branch); CREATE INDEX Derivations_index ON Derivations(derivation, evaluation, job_name, system); COMMIT; |