aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-11-21 20:48:58 +0000
committerChristopher Baines <mail@cbaines.net>2019-11-21 20:48:58 +0000
commit75d5e4b9d5bdaf86329b33f25b824c506e190b79 (patch)
tree0cc27226d779e0611473e6af756d057cffc32de6
parentae150888d8fa26243bf4bc4cf48d0ab366a5f843 (diff)
downloaddata-service-75d5e4b9d5bdaf86329b33f25b824c506e190b79.tar
data-service-75d5e4b9d5bdaf86329b33f25b824c506e190b79.tar.gz
Fix select-guix-revision-for-branch-and-datetime
Flip the inequality and order, as this was picking the first revision after the datetime, rather than the last revision before it, which was the intention, as this should give you the revision on the branch, at the datetime.
-rw-r--r--guix-data-service/model/guix-revision.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/guix-data-service/model/guix-revision.scm b/guix-data-service/model/guix-revision.scm
index 8221ab4..8578008 100644
--- a/guix-data-service/model/guix-revision.scm
+++ b/guix-data-service/model/guix-revision.scm
@@ -72,8 +72,8 @@ FROM guix_revisions
INNER JOIN git_branches
ON git_branches.commit = guix_revisions.commit
AND git_branches.git_repository_id = guix_revisions.git_repository_id
-WHERE git_branches.name = $1 AND git_branches.datetime >= $2
-ORDER BY git_branches.datetime ASC
+WHERE git_branches.name = $1 AND git_branches.datetime <= $2
+ORDER BY git_branches.datetime DESC
LIMIT 1")
(car