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:
parent
1955350318
commit
647fa025f8
1 changed files with 1 additions and 1 deletions
|
@ -178,7 +178,7 @@ func (s *Storage) WeeklyFeedEntryCount(userID, feedID int64) (int, error) {
|
|||
WHERE
|
||||
entries.user_id=$1 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
|
||||
|
|
Loading…
Reference in a new issue