mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
parent
25c9b779e4
commit
4b39d37cae
19 changed files with 494 additions and 275 deletions
54
server/src/queries/activity.repository.sql
Normal file
54
server/src/queries/activity.repository.sql
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
-- NOTE: This file is auto generated by ./sql-generator
|
||||
|
||||
-- ActivityRepository.search
|
||||
SELECT
|
||||
"ActivityEntity"."id" AS "ActivityEntity_id",
|
||||
"ActivityEntity"."createdAt" AS "ActivityEntity_createdAt",
|
||||
"ActivityEntity"."updatedAt" AS "ActivityEntity_updatedAt",
|
||||
"ActivityEntity"."albumId" AS "ActivityEntity_albumId",
|
||||
"ActivityEntity"."userId" AS "ActivityEntity_userId",
|
||||
"ActivityEntity"."assetId" AS "ActivityEntity_assetId",
|
||||
"ActivityEntity"."comment" AS "ActivityEntity_comment",
|
||||
"ActivityEntity"."isLiked" AS "ActivityEntity_isLiked",
|
||||
"ActivityEntity__ActivityEntity_user"."id" AS "ActivityEntity__ActivityEntity_user_id",
|
||||
"ActivityEntity__ActivityEntity_user"."name" AS "ActivityEntity__ActivityEntity_user_name",
|
||||
"ActivityEntity__ActivityEntity_user"."avatarColor" AS "ActivityEntity__ActivityEntity_user_avatarColor",
|
||||
"ActivityEntity__ActivityEntity_user"."isAdmin" AS "ActivityEntity__ActivityEntity_user_isAdmin",
|
||||
"ActivityEntity__ActivityEntity_user"."email" AS "ActivityEntity__ActivityEntity_user_email",
|
||||
"ActivityEntity__ActivityEntity_user"."storageLabel" AS "ActivityEntity__ActivityEntity_user_storageLabel",
|
||||
"ActivityEntity__ActivityEntity_user"."oauthId" AS "ActivityEntity__ActivityEntity_user_oauthId",
|
||||
"ActivityEntity__ActivityEntity_user"."profileImagePath" AS "ActivityEntity__ActivityEntity_user_profileImagePath",
|
||||
"ActivityEntity__ActivityEntity_user"."shouldChangePassword" AS "ActivityEntity__ActivityEntity_user_shouldChangePassword",
|
||||
"ActivityEntity__ActivityEntity_user"."createdAt" AS "ActivityEntity__ActivityEntity_user_createdAt",
|
||||
"ActivityEntity__ActivityEntity_user"."deletedAt" AS "ActivityEntity__ActivityEntity_user_deletedAt",
|
||||
"ActivityEntity__ActivityEntity_user"."status" AS "ActivityEntity__ActivityEntity_user_status",
|
||||
"ActivityEntity__ActivityEntity_user"."updatedAt" AS "ActivityEntity__ActivityEntity_user_updatedAt",
|
||||
"ActivityEntity__ActivityEntity_user"."memoriesEnabled" AS "ActivityEntity__ActivityEntity_user_memoriesEnabled",
|
||||
"ActivityEntity__ActivityEntity_user"."quotaSizeInBytes" AS "ActivityEntity__ActivityEntity_user_quotaSizeInBytes",
|
||||
"ActivityEntity__ActivityEntity_user"."quotaUsageInBytes" AS "ActivityEntity__ActivityEntity_user_quotaUsageInBytes"
|
||||
FROM
|
||||
"activity" "ActivityEntity"
|
||||
LEFT JOIN "users" "ActivityEntity__ActivityEntity_user" ON "ActivityEntity__ActivityEntity_user"."id" = "ActivityEntity"."userId"
|
||||
AND (
|
||||
"ActivityEntity__ActivityEntity_user"."deletedAt" IS NULL
|
||||
)
|
||||
WHERE
|
||||
(("ActivityEntity"."albumId" = $1))
|
||||
ORDER BY
|
||||
"ActivityEntity"."createdAt" ASC
|
||||
|
||||
-- ActivityRepository.getStatistics
|
||||
SELECT
|
||||
COUNT(DISTINCT ("ActivityEntity"."id")) AS "cnt"
|
||||
FROM
|
||||
"activity" "ActivityEntity"
|
||||
LEFT JOIN "users" "ActivityEntity__ActivityEntity_user" ON "ActivityEntity__ActivityEntity_user"."id" = "ActivityEntity"."userId"
|
||||
AND (
|
||||
"ActivityEntity__ActivityEntity_user"."deletedAt" IS NULL
|
||||
)
|
||||
WHERE
|
||||
(
|
||||
("ActivityEntity"."assetId" = $1)
|
||||
AND ("ActivityEntity"."albumId" = $2)
|
||||
AND ("ActivityEntity"."isLiked" = $3)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue