mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 17:25:35 +03:00
refactor: migrate library spec to factories (#16711)
This commit is contained in:
@@ -2,34 +2,7 @@
|
||||
|
||||
-- LibraryRepository.get
|
||||
select
|
||||
"libraries".*,
|
||||
(
|
||||
select
|
||||
to_json(obj)
|
||||
from
|
||||
(
|
||||
select
|
||||
"users"."id",
|
||||
"users"."email",
|
||||
"users"."createdAt",
|
||||
"users"."profileImagePath",
|
||||
"users"."isAdmin",
|
||||
"users"."shouldChangePassword",
|
||||
"users"."deletedAt",
|
||||
"users"."oauthId",
|
||||
"users"."updatedAt",
|
||||
"users"."storageLabel",
|
||||
"users"."name",
|
||||
"users"."quotaSizeInBytes",
|
||||
"users"."quotaUsageInBytes",
|
||||
"users"."status",
|
||||
"users"."profileChangedAt"
|
||||
from
|
||||
"users"
|
||||
where
|
||||
"users"."id" = "libraries"."ownerId"
|
||||
) as obj
|
||||
) as "owner"
|
||||
"libraries".*
|
||||
from
|
||||
"libraries"
|
||||
where
|
||||
@@ -38,34 +11,7 @@ where
|
||||
|
||||
-- LibraryRepository.getAll
|
||||
select
|
||||
"libraries".*,
|
||||
(
|
||||
select
|
||||
to_json(obj)
|
||||
from
|
||||
(
|
||||
select
|
||||
"users"."id",
|
||||
"users"."email",
|
||||
"users"."createdAt",
|
||||
"users"."profileImagePath",
|
||||
"users"."isAdmin",
|
||||
"users"."shouldChangePassword",
|
||||
"users"."deletedAt",
|
||||
"users"."oauthId",
|
||||
"users"."updatedAt",
|
||||
"users"."storageLabel",
|
||||
"users"."name",
|
||||
"users"."quotaSizeInBytes",
|
||||
"users"."quotaUsageInBytes",
|
||||
"users"."status",
|
||||
"users"."profileChangedAt"
|
||||
from
|
||||
"users"
|
||||
where
|
||||
"users"."id" = "libraries"."ownerId"
|
||||
) as obj
|
||||
) as "owner"
|
||||
"libraries".*
|
||||
from
|
||||
"libraries"
|
||||
where
|
||||
@@ -75,34 +21,7 @@ order by
|
||||
|
||||
-- LibraryRepository.getAllDeleted
|
||||
select
|
||||
"libraries".*,
|
||||
(
|
||||
select
|
||||
to_json(obj)
|
||||
from
|
||||
(
|
||||
select
|
||||
"users"."id",
|
||||
"users"."email",
|
||||
"users"."createdAt",
|
||||
"users"."profileImagePath",
|
||||
"users"."isAdmin",
|
||||
"users"."shouldChangePassword",
|
||||
"users"."deletedAt",
|
||||
"users"."oauthId",
|
||||
"users"."updatedAt",
|
||||
"users"."storageLabel",
|
||||
"users"."name",
|
||||
"users"."quotaSizeInBytes",
|
||||
"users"."quotaUsageInBytes",
|
||||
"users"."status",
|
||||
"users"."profileChangedAt"
|
||||
from
|
||||
"users"
|
||||
where
|
||||
"users"."id" = "libraries"."ownerId"
|
||||
) as obj
|
||||
) as "owner"
|
||||
"libraries".*
|
||||
from
|
||||
"libraries"
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user