From 4e661552c3a0bebd9b584dcf72b9e949fb5582ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= Date: Sun, 2 Sep 2018 09:45:48 +0200 Subject: database: Add builds only if one of their outputs is new. * Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-4.sql'. * src/cuirass/database.scm (db-add-output): New procedure. (db-add-build): Call DB-ADD-OUTPUT, rollback the transaction and return #f if DB-ADD-OUTPUT returned an empty list. * src/schema.sql (Outputs): Set 'path' as primary key, instead of 'derivation, name'. * src/sql/upgrade-4.sql: New file with SQL queries to upgrade the database. * tests/database.scm (make-dummy-build): Use the #:OUTPUTS key. Get default OUTPUTS to depend on DRV. ("db-add-build-with-fixed-output"): New test. --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 2f83659..7cea2ff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,7 +67,8 @@ dist_pkgdata_DATA = src/schema.sql dist_sql_DATA = \ src/sql/upgrade-1.sql \ src/sql/upgrade-2.sql \ - src/sql/upgrade-3.sql + src/sql/upgrade-3.sql \ + src/sql/upgrade-4.sql dist_css_DATA = \ src/static/css/bootstrap.css \ -- cgit v1.2.3