From 625e90889476db13bf1825c0c87c2cecff6d7722 Mon Sep 17 00:00:00 2001 From: Thibault bui Koechlin Date: Fri, 26 Jun 2020 17:51:45 +0200 Subject: [PATCH] fix sql query --- pkg/sqlite/commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sqlite/commit.go b/pkg/sqlite/commit.go index c921d3212..82d1c4450 100644 --- a/pkg/sqlite/commit.go +++ b/pkg/sqlite/commit.go @@ -46,7 +46,7 @@ func (c *Context) CleanUpRecordsByAge() error { //look for soft-deleted events that are OLDER than maxDurationRetention ret := c.Db.Unscoped().Table("ban_applications").Where("deleted_at is not NULL"). - Where(fmt.Sprintf("deleted_at > data('now','-%d minutes')", int(c.maxDurationRetention.Minutes()))). + Where(fmt.Sprintf("deleted_at > date('now','-%d minutes')", int(c.maxDurationRetention.Minutes()))). Order("updated_at desc").Find(&sos) if ret.Error != nil {