aboutsummaryrefslogtreecommitdiff
path: root/src/sql
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-09-06 13:03:08 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-09-06 13:03:08 +0200
commit154232bc767d002f69aa6bb1cdddfd108b98584b (patch)
treeeaa8e4791821513d3df9af613e92533b998bdaf8 /src/sql
parentb135a02bf22a59f5d8b916b5068961e774fb44b5 (diff)
downloadcuirass-154232bc767d002f69aa6bb1cdddfd108b98584b.tar
cuirass-154232bc767d002f69aa6bb1cdddfd108b98584b.tar.gz
Save evaluations and checkouts timestamps.
src/cuirass/base.scm (fetch-input): Add the commit timestamp to the returned association list, (process-specs): Pass a timestamp taken at procedure start and another one taken after inputs are fetched to "db-add-evaluation" procedure. Once the evaluation is over, call "db-set-evaluation-time" to save the evaluation completion time. src/cuirass/database.scm (db-set-evaluation-time): New procedure, (db-add-checkout): Handle the "timestamp" field, (db-add-evaluation): add "checkouttime" and "evaltime" arguments. Modify the associated SQL query accordingly. (db-get-builds): Use "Builds.timestamp" instead of "timestamp" as this field is also part of the Evaluations table. src/schema.sql (Checkouts): Add "timestamp" field, (Evaluations): add "timestamp", "checkouttime" and "evaltime" fields. src/sql/upgrade-9.sql: New file. tests/database.scm (sqlite-exec): Adapt Evaluations table insertions to include "timestamp", "checkouttime" and "evaltime" required fields.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/upgrade-9.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sql/upgrade-9.sql b/src/sql/upgrade-9.sql
new file mode 100644
index 0000000..4de411a
--- /dev/null
+++ b/src/sql/upgrade-9.sql
@@ -0,0 +1,9 @@
+BEGIN TRANSACTION;
+
+ALTER TABLE Evaluations ADD timestamp INTEGER NOT NULL DEFAULT 0;
+ALTER TABLE Evaluations ADD checkouttime INTEGER NOT NULL DEFAULT 0;
+ALTER TABLE Evaluations ADD evaltime INTEGER NOT NULL DEFAULT 0;
+
+ALTER TABLE Checkouts ADD timestamp INTEGER NOT NULL DEFAULT 0;
+
+COMMIT;