Removed timestamp problems (i think)

This commit is contained in:
Peder Vatn Austad
2024-12-26 17:57:35 +01:00
parent 83e8b7106e
commit db7485d140

View File

@@ -6,6 +6,13 @@ import (
) )
func InsertOrUpdateEstimatedCall(db *sql.DB, values []interface{}) (int, string, error) { 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 := ` query := `
INSERT INTO calls ( INSERT INTO calls (
estimatedvehiclejourney, "order", stoppointref, estimatedvehiclejourney, "order", stoppointref,