2024-03-30 00:16:06 -04:00
|
|
|
-- NOTE: This file is auto generated by ./sql-generator
|
|
|
|
|
|
|
|
|
|
-- ActivityRepository.search
|
2025-01-09 20:31:46 +01:00
|
|
|
select
|
|
|
|
|
"activity".*,
|
2024-04-25 23:45:15 +02:00
|
|
|
(
|
2025-01-09 20:31:46 +01:00
|
|
|
select
|
|
|
|
|
to_json(obj)
|
|
|
|
|
from
|
2024-04-25 23:45:15 +02:00
|
|
|
(
|
2025-01-09 20:31:46 +01:00
|
|
|
select
|
2025-01-15 23:31:26 -05:00
|
|
|
"id",
|
|
|
|
|
"name",
|
|
|
|
|
"email",
|
|
|
|
|
"profileImagePath",
|
|
|
|
|
"profileChangedAt"
|
2025-01-09 20:31:46 +01:00
|
|
|
from
|
|
|
|
|
"users"
|
|
|
|
|
where
|
|
|
|
|
"users"."id" = "activity"."userId"
|
|
|
|
|
and "users"."deletedAt" is null
|
|
|
|
|
) as obj
|
|
|
|
|
) as "user"
|
|
|
|
|
from
|
|
|
|
|
"activity"
|
|
|
|
|
left join "assets" on "assets"."id" = "activity"."assetId"
|
|
|
|
|
and "assets"."deletedAt" is null
|
|
|
|
|
where
|
|
|
|
|
"activity"."albumId" = $1
|
|
|
|
|
order by
|
|
|
|
|
"activity"."createdAt" asc
|
2024-03-30 00:16:06 -04:00
|
|
|
|
|
|
|
|
-- ActivityRepository.getStatistics
|
2025-01-09 20:31:46 +01:00
|
|
|
select
|
|
|
|
|
count(*) as "count"
|
|
|
|
|
from
|
|
|
|
|
"activity"
|
2025-01-10 00:14:36 +01:00
|
|
|
inner join "users" on "users"."id" = "activity"."userId"
|
|
|
|
|
and "users"."deletedAt" is null
|
2025-01-09 20:31:46 +01:00
|
|
|
left join "assets" on "assets"."id" = "activity"."assetId"
|
|
|
|
|
where
|
|
|
|
|
"activity"."assetId" = $1
|
|
|
|
|
and "activity"."albumId" = $2
|
|
|
|
|
and "activity"."isLiked" = $3
|
|
|
|
|
and "assets"."deletedAt" is null
|
2025-02-13 22:30:12 +01:00
|
|
|
and "assets"."fileCreatedAt" is not null
|
|
|
|
|
and "assets"."fileModifiedAt" is not null
|
|
|
|
|
and "assets"."localDateTime" is not null
|