aboutsummaryrefslogtreecommitdiff
path: root/src/schema.sql
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-26 16:53:57 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-27 14:17:09 +0200
commitd493a58823aed8c556bf795d02207e57718b96c9 (patch)
tree1fbb66eda8315b3d7cfa5074049779c02462c920 /src/schema.sql
parent0225d696424b0826af210fdeef770a2310252c64 (diff)
downloadcuirass-d493a58823aed8c556bf795d02207e57718b96c9.tar
cuirass-d493a58823aed8c556bf795d02207e57718b96c9.tar.gz
schema: Separate "Derivations" from "Evaluations".
* src/schema.sql (Derivations): New table. (Evaluations): Remove 'derivation' and 'job_name' columns. Add 'id' column. * src/cuirass/database.scm (db-add-evaluation): Adapt. (db-get-derivation, db-add-derivation): New procedures. (evaluation-exists?, db-get-evaluation): Delete. * bin/evaluate.in (main): Adapt. * tests/database.scm ("sqlite-exec"): Likewise. ("db-add-derivation", "db-get-derivation"): New tests. ("db-add-evaluation", "db-get-evaluation"): Delete.
Diffstat (limited to 'src/schema.sql')
-rw-r--r--src/schema.sql11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/schema.sql b/src/schema.sql
index d5c1f00..248f9d2 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -21,12 +21,19 @@ CREATE TABLE Stamps (
);
CREATE TABLE Evaluations (
- derivation TEXT NOT NULL PRIMARY KEY,
- job_name TEXT NOT NULL,
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
specification INTEGER NOT NULL,
FOREIGN KEY (specification) REFERENCES Specifications (id)
);
+CREATE TABLE Derivations (
+ derivation TEXT NOT NULL,
+ evaluation INTEGER NOT NULL,
+ job_name TEXT NOT NULL,
+ PRIMARY KEY (derivation, evaluation),
+ FOREIGN KEY (evaluation) REFERENCES Evaluations (id)
+);
+
CREATE TABLE Builds (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
derivation TEXT NOT NULL,