From f5d3080b88cfce23736ca77a514a68e2b38d42da Mon Sep 17 00:00:00 2001 From: Dries De Peuter Date: Wed, 11 Jan 2023 01:17:07 +0100 Subject: [PATCH] fix: Fix mysql query --- internal/pkg/versions/versions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/versions/versions.go b/internal/pkg/versions/versions.go index faea011..7be626c 100644 --- a/internal/pkg/versions/versions.go +++ b/internal/pkg/versions/versions.go @@ -135,7 +135,7 @@ func GetAllLast(days *int) []Version { if days != nil { switch storage.EngineType { case "mysql": - filter = fmt.Sprintf("WHERE timestamp > DATE_SUB(NOW(), INTERVAL %d DAYS)", *days) + filter = fmt.Sprintf("WHERE timestamp > NOW() - INTERVAL %d DAY", *days) case "sqlite": filter = fmt.Sprintf("where timestamp > date('now', '-%d days')", *days) }