aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tw/services/personal-data-exporter.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/tw/services/personal-data-exporter.scm b/tw/services/personal-data-exporter.scm
index fb998459..18a048e1 100644
--- a/tw/services/personal-data-exporter.scm
+++ b/tw/services/personal-data-exporter.scm
@@ -100,7 +100,8 @@ completely managed by @code{personal-data-exporter-service-type}."))
(match-lambda
(($ <data-point> date value)
(let ((date-type (if (string-contains date " ") "timestamp" "date")))
- (dbi-query db (format #f "insert into \"~a\" values (~a '~a', ~a);"
+ ;; If a value already exists for any given point in time, replace it.
+ (dbi-query db (format #f "insert into \"~a\" values (~a '~a', ~a) on conflict (\"time\") do update;"
table date-type date value))))))
(let ((settings (call-with-input-file #$conso-config-file json->settings))