aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-11-28 19:32:00 +0000
committerChristopher Baines <mail@cbaines.net>2019-11-28 19:32:00 +0000
commit20c75e11038de62efd9fe8ae6ce41782f5a18172 (patch)
treee3c59393b9a8d2f1946dcb91bb23c6249a1550d3 /guix-data-service
parentaf1324855e1ecaf9b1dd7afcc714d09aaa38f081 (diff)
downloaddata-service-20c75e11038de62efd9fe8ae6ce41782f5a18172.tar
data-service-20c75e11038de62efd9fe8ae6ce41782f5a18172.tar.gz
Fix some queries relating to the build_status table changes
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/model/derivation.scm16
1 files changed, 8 insertions, 8 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index 2e2cdd8..bfee9eb 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -95,13 +95,13 @@ INNER JOIN guix_revision_package_derivations
ON package_derivations.id = guix_revision_package_derivations.package_derivation_id
INNER JOIN guix_revisions
ON guix_revision_package_derivations.revision_id = guix_revisions.id
-LEFT OUTER JOIN builds ON derivations.id = builds.derivation_id
+LEFT OUTER JOIN builds ON derivations.file_name = builds.derivation_file_name
LEFT OUTER JOIN (
- SELECT DISTINCT ON (internal_build_id) *
+ SELECT DISTINCT ON (build_id) *
FROM build_status
- ORDER BY internal_build_id, status_fetched_at DESC
+ ORDER BY build_id, timestamp DESC
) AS latest_build_status
- ON builds.internal_id = latest_build_status.internal_build_id
+ ON builds.id = latest_build_status.build_id
WHERE guix_revisions.commit = $1
AND packages.name = $2
AND packages.version = $3
@@ -569,13 +569,13 @@ FROM derivations
INNER JOIN package_derivations
ON derivations.id = package_derivations.derivation_id
LEFT OUTER JOIN builds
- ON derivations.id = builds.derivation_id
+ ON derivations.file_name = builds.derivation_file_name
LEFT OUTER JOIN (
- SELECT DISTINCT ON (internal_build_id) *
+ SELECT DISTINCT ON (build_id) *
FROM build_status
- ORDER BY internal_build_id, status_fetched_at DESC
+ ORDER BY build_id, timestamp DESC
) AS latest_build_status
-ON builds.internal_id = latest_build_status.internal_build_id
+ ON builds.id = latest_build_status.build_id
WHERE " criteria ";"))
(exec-query conn query))