From db7485d140022ec0cdeaa43bd04012be7d5b85f9 Mon Sep 17 00:00:00 2001 From: Peder Vatn Austad Date: Thu, 26 Dec 2024 17:57:35 +0100 Subject: [PATCH] Removed timestamp problems (i think) --- database/EstimatedCall.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/database/EstimatedCall.go b/database/EstimatedCall.go index ddb6f88..ac7cf3b 100644 --- a/database/EstimatedCall.go +++ b/database/EstimatedCall.go @@ -6,6 +6,13 @@ import ( ) func InsertOrUpdateEstimatedCall(db *sql.DB, values []interface{}) (int, string, error) { + // Replace empty strings with nil for timestamp fields + for i, v := range values { + if str, ok := v.(string); ok && str == "" { + values[i] = nil + } + } + query := ` INSERT INTO calls ( estimatedvehiclejourney, "order", stoppointref,