mirror of
https://github.com/immich-app/immich.git
synced 2026-02-14 04:47:57 +03:00
chore(web): quota enhancement (#6371)
* chore(web): quota enhancement * show quota in user table * update quota for single user ioption * Add a note how to set unlimited storage * fixed deletion doesn't update quota * refactor relation * fixed test * re-refactor * update sql * fix e2e test * Update server/src/domain/user/user.service.ts Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> * revert e2e test --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
@@ -150,3 +150,19 @@ GROUP BY
|
||||
"users"."id"
|
||||
ORDER BY
|
||||
"users"."createdAt" ASC
|
||||
|
||||
-- UserRepository.syncUsage
|
||||
UPDATE "users"
|
||||
SET
|
||||
"quotaUsageInBytes" = (
|
||||
SELECT
|
||||
COALESCE(SUM(exif."fileSizeInByte"), 0)
|
||||
FROM
|
||||
"assets" "assets"
|
||||
LEFT JOIN "exif" "exif" ON "exif"."assetId" = "assets"."id"
|
||||
WHERE
|
||||
"assets"."ownerId" = users.id
|
||||
),
|
||||
"updatedAt" = CURRENT_TIMESTAMP
|
||||
WHERE
|
||||
users.id = $1
|
||||
|
||||
Reference in New Issue
Block a user