Files
immich/server/src/queries/activity.repository.sql
Jonathan Jogenfors 5407a28533 feat(server): Nullable asset dates (#15669)
* nullable dates

* wip

* don't search for null dates

* Add placeholder type

* cleanup
2025-02-13 15:30:12 -06:00

49 lines
1.1 KiB
SQL

-- NOTE: This file is auto generated by ./sql-generator
-- ActivityRepository.search
select
"activity".*,
(
select
to_json(obj)
from
(
select
"id",
"name",
"email",
"profileImagePath",
"profileChangedAt"
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
-- ActivityRepository.getStatistics
select
count(*) as "count"
from
"activity"
inner join "users" on "users"."id" = "activity"."userId"
and "users"."deletedAt" is null
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
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null