Simplify WeeklyFeedEntryCount

No need for a `BETWEEN`: we want to filter on entries published in the last
week, no need to express is as "entries published between now and last week",
"entries published after last week" is enough.
This commit is contained in:
jvoisin 2024-02-25 16:25:35 +01:00 committed by Frédéric Guillot
parent 1955350318
commit 647fa025f8

View file

@ -178,7 +178,7 @@ func (s *Storage) WeeklyFeedEntryCount(userID, feedID int64) (int, error) {
WHERE WHERE
entries.user_id=$1 AND entries.user_id=$1 AND
entries.feed_id=$2 AND entries.feed_id=$2 AND
entries.published_at BETWEEN (now() - interval '1 week') AND now(); entries.published_at >= now() - interval '1 week';
` `
var weeklyCount int var weeklyCount int