aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/model/git-branch.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-16 00:03:06 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-16 00:03:06 +0100
commite6effe7556490b2f4a3ec69b784125129ed93aab (patch)
treebcc8c223bebbb4fb48ed768e6d97a1fdbc098a31 /guix-data-service/model/git-branch.scm
parent16799a34a96bfa240b3eb47d75c935afab8c51a1 (diff)
downloaddata-service-e6effe7556490b2f4a3ec69b784125129ed93aab.tar
data-service-e6effe7556490b2f4a3ec69b784125129ed93aab.tar.gz
Fix how email dates are inserted in to PostgreSQL
Previously, the timezone was stripped off, so the timestamps were off. This commit changes the code to use a Unix timestamp, which avoids this issue.
Diffstat (limited to 'guix-data-service/model/git-branch.scm')
-rw-r--r--guix-data-service/model/git-branch.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/guix-data-service/model/git-branch.scm b/guix-data-service/model/git-branch.scm
index 8dec755..5af7218 100644
--- a/guix-data-service/model/git-branch.scm
+++ b/guix-data-service/model/git-branch.scm
@@ -13,12 +13,12 @@
conn
(string-append
"INSERT INTO git_branches (name, commit, git_repository_id, datetime) "
- "VALUES ($1, $2, $3, $4) "
+ "VALUES ($1, $2, $3, to_timestamp($4)) "
"ON CONFLICT DO NOTHING")
(list name
commit
git-repository-id
- datetime)))
+ (date->string datetime "~s"))))
(define (git-branches-for-commit conn commit)
(define query