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.
This commit is contained in:
Christopher Baines 2019-05-16 00:03:06 +01:00
parent 16799a34a9
commit e6effe7556
3 changed files with 5 additions and 4 deletions

View file

@ -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