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,