Reformat's ArchiveEntries's query for consistency's sake
And replace the `=ANY` with an `IN`
This commit is contained in:
parent
26d189917e
commit
66e0eb1bd6
1 changed files with 18 additions and 6 deletions
|
@ -333,7 +333,19 @@ func (s *Storage) ArchiveEntries(status string, days, limit int) (int64, error)
|
|||
SET
|
||||
status=$1
|
||||
WHERE
|
||||
id=ANY(SELECT id FROM entries WHERE status=$2 AND starred is false AND share_code='' AND created_at < now () - '%d days'::interval ORDER BY created_at ASC LIMIT %d)
|
||||
id IN (
|
||||
SELECT
|
||||
id
|
||||
FROM
|
||||
entries
|
||||
WHERE
|
||||
status=$2 AND
|
||||
starred is false AND
|
||||
share_code='' AND
|
||||
created_at < now () - '%d days'::interval
|
||||
ORDER BY
|
||||
created_at ASC LIMIT %d
|
||||
)
|
||||
`
|
||||
|
||||
result, err := s.db.Exec(fmt.Sprintf(query, days, limit), model.EntryStatusRemoved, status)
|
||||
|
|
Loading…
Reference in a new issue