fix: time bucket grouping (#19329)

This commit is contained in:
Jason Rasmussen 2025-06-20 09:46:30 -04:00 committed by GitHub
parent 11c469907f
commit 33c9f88ba4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 15 deletions

View file

@ -224,7 +224,7 @@ limit
with
"assets" as (
select
date_trunc('MONTH', "localDateTime" at time zone 'UTC') at time zone 'UTC' as "timeBucket"
date_trunc('MONTH', "localDateTime" AT TIME ZONE 'UTC') AT TIME ZONE 'UTC' as "timeBucket"
from
"assets"
where
@ -232,7 +232,7 @@ with
and "assets"."visibility" in ('archive', 'timeline')
)
select
"timeBucket"::date::text as "timeBucket",
("timeBucket" AT TIME ZONE 'UTC')::date::text as "timeBucket",
count(*) as "count"
from
"assets"
@ -300,7 +300,7 @@ with
where
"assets"."deletedAt" is null
and "assets"."visibility" in ('archive', 'timeline')
and date_trunc('MONTH', "localDateTime" at time zone 'UTC') at time zone 'UTC' = $2
and date_trunc('MONTH', "localDateTime" AT TIME ZONE 'UTC') AT TIME ZONE 'UTC' = $2
and not exists (
select
from