Skip to content

Commit

Permalink
fix: Fix mysql query
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Jan 11, 2023
1 parent 11d5062 commit f5d3080
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg/versions/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f5d3080

Please sign in to comment.