aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/model/build.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-04-23 11:14:51 +0100
committerChristopher Baines <mail@cbaines.net>2021-04-23 11:14:51 +0100
commitb430c632b75e5e90e36a855599e3f91302720d54 (patch)
treef3f24dfa752b0255c95d2b489480a3b264b808e2 /guix-data-service/model/build.scm
parent1cc5accb9e7d066211646bb92e8efe7a89c35327 (diff)
downloaddata-service-b430c632b75e5e90e36a855599e3f91302720d54.tar
data-service-b430c632b75e5e90e36a855599e3f91302720d54.tar.gz
Create a table for systems
And use it for the systems in the derivations and package derivations tables. The primary motivation here is to allow quickly working out what systems the database contains, and having a small table with just the right data seems a good way to do that.
Diffstat (limited to 'guix-data-service/model/build.scm')
-rw-r--r--guix-data-service/model/build.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/guix-data-service/model/build.scm b/guix-data-service/model/build.scm
index d0a75b1..3d38e67 100644
--- a/guix-data-service/model/build.scm
+++ b/guix-data-service/model/build.scm
@@ -23,6 +23,7 @@
#:use-module (json)
#:use-module (guix-data-service database)
#:use-module (guix-data-service model utils)
+ #:use-module (guix-data-service model system)
#:export (select-build-stats
select-builds-with-context
select-builds-with-context-by-derivation-file-name
@@ -51,7 +52,8 @@
`(("guix_revisions.commit = $" . ,revision-commit))
'())
,@(if system
- `(("package_derivations.system = $" . ,system))
+ `(("package_derivations.system_id = $" .
+ ,(system->system-id conn system)))
'())
,@(if target
`(("package_derivations.target = $" . ,target))
@@ -143,7 +145,8 @@ ORDER BY status"))
`(("guix_revisions.commit = $" . ,revision-commit))
'())
,@(if system
- `(("package_derivations.system = $" . ,system))
+ `(("package_derivations.system_id = $" .
+ ,(system->system-id conn system)))
'())
,@(if target
`(("package_derivations.target = $" . ,target))