mirror of
https://github.com/LukeHagar/immich.git
synced 2025-12-06 12:37:48 +00:00
* - add component - update server's StackCreateDto for merge parameter - Update stackRepo to only merge stacks when merge=true (default) - update web action handlers to show stack changes * - make open-api * lint & format * - Add proper icon to 'remove from stack' - change web unstack icon to image-off-outline * - cleanup * - format & lint * - make open-api: StackCreateDto merge optional * initial addition of new endpoint * remove stack endpoint * - fix up remove stack endpoint - open-api * - Undo stackCreate merge parameter * - open-api typescript * open-api dart * Tests: - add tests - update assetStub.imageFrom2015 to have required stack attributes to include it with tests * update event name * Fix event name in test * remove asset_update check * - merge stack.removeAsset params into one object - refactor asset existence check (no need for asset fetch) - fix tests * Don't return updated stack * Create specialized stack id & primary asset fetch for asset removal checks * Correct new permission names * make sql * - fix open-api * - cleanup
156 lines
4.5 KiB
SQL
156 lines
4.5 KiB
SQL
-- NOTE: This file is auto generated by ./sql-generator
|
|
|
|
-- StackRepository.search
|
|
select
|
|
"stack".*,
|
|
(
|
|
select
|
|
coalesce(json_agg(agg), '[]')
|
|
from
|
|
(
|
|
select
|
|
"asset".*,
|
|
to_json("exifInfo") as "exifInfo"
|
|
from
|
|
"asset"
|
|
inner join lateral (
|
|
select
|
|
"asset_exif"."assetId",
|
|
"asset_exif"."autoStackId",
|
|
"asset_exif"."bitsPerSample",
|
|
"asset_exif"."city",
|
|
"asset_exif"."colorspace",
|
|
"asset_exif"."country",
|
|
"asset_exif"."dateTimeOriginal",
|
|
"asset_exif"."description",
|
|
"asset_exif"."exifImageHeight",
|
|
"asset_exif"."exifImageWidth",
|
|
"asset_exif"."exposureTime",
|
|
"asset_exif"."fileSizeInByte",
|
|
"asset_exif"."fNumber",
|
|
"asset_exif"."focalLength",
|
|
"asset_exif"."fps",
|
|
"asset_exif"."iso",
|
|
"asset_exif"."latitude",
|
|
"asset_exif"."lensModel",
|
|
"asset_exif"."livePhotoCID",
|
|
"asset_exif"."longitude",
|
|
"asset_exif"."make",
|
|
"asset_exif"."model",
|
|
"asset_exif"."modifyDate",
|
|
"asset_exif"."orientation",
|
|
"asset_exif"."profileDescription",
|
|
"asset_exif"."projectionType",
|
|
"asset_exif"."rating",
|
|
"asset_exif"."state",
|
|
"asset_exif"."timeZone"
|
|
from
|
|
"asset_exif"
|
|
where
|
|
"asset_exif"."assetId" = "asset"."id"
|
|
) as "exifInfo" on true
|
|
where
|
|
"asset"."deletedAt" is null
|
|
and "asset"."stackId" = "stack"."id"
|
|
and "asset"."visibility" in ('archive', 'timeline')
|
|
) as agg
|
|
) as "assets"
|
|
from
|
|
"stack"
|
|
where
|
|
"stack"."ownerId" = $1
|
|
|
|
-- StackRepository.delete
|
|
delete from "stack"
|
|
where
|
|
"id" = $1::uuid
|
|
|
|
-- StackRepository.getById
|
|
select
|
|
*,
|
|
(
|
|
select
|
|
coalesce(json_agg(agg), '[]')
|
|
from
|
|
(
|
|
select
|
|
"asset".*,
|
|
(
|
|
select
|
|
coalesce(json_agg(agg), '[]')
|
|
from
|
|
(
|
|
select
|
|
"tag"."id",
|
|
"tag"."value",
|
|
"tag"."createdAt",
|
|
"tag"."updatedAt",
|
|
"tag"."color",
|
|
"tag"."parentId"
|
|
from
|
|
"tag"
|
|
inner join "tag_asset" on "tag"."id" = "tag_asset"."tagsId"
|
|
where
|
|
"tag_asset"."assetsId" = "asset"."id"
|
|
) as agg
|
|
) as "tags",
|
|
to_json("exifInfo") as "exifInfo"
|
|
from
|
|
"asset"
|
|
inner join lateral (
|
|
select
|
|
"asset_exif"."assetId",
|
|
"asset_exif"."autoStackId",
|
|
"asset_exif"."bitsPerSample",
|
|
"asset_exif"."city",
|
|
"asset_exif"."colorspace",
|
|
"asset_exif"."country",
|
|
"asset_exif"."dateTimeOriginal",
|
|
"asset_exif"."description",
|
|
"asset_exif"."exifImageHeight",
|
|
"asset_exif"."exifImageWidth",
|
|
"asset_exif"."exposureTime",
|
|
"asset_exif"."fileSizeInByte",
|
|
"asset_exif"."fNumber",
|
|
"asset_exif"."focalLength",
|
|
"asset_exif"."fps",
|
|
"asset_exif"."iso",
|
|
"asset_exif"."latitude",
|
|
"asset_exif"."lensModel",
|
|
"asset_exif"."livePhotoCID",
|
|
"asset_exif"."longitude",
|
|
"asset_exif"."make",
|
|
"asset_exif"."model",
|
|
"asset_exif"."modifyDate",
|
|
"asset_exif"."orientation",
|
|
"asset_exif"."profileDescription",
|
|
"asset_exif"."projectionType",
|
|
"asset_exif"."rating",
|
|
"asset_exif"."state",
|
|
"asset_exif"."timeZone"
|
|
from
|
|
"asset_exif"
|
|
where
|
|
"asset_exif"."assetId" = "asset"."id"
|
|
) as "exifInfo" on true
|
|
where
|
|
"asset"."deletedAt" is null
|
|
and "asset"."stackId" = "stack"."id"
|
|
and "asset"."visibility" in ('archive', 'timeline')
|
|
) as agg
|
|
) as "assets"
|
|
from
|
|
"stack"
|
|
where
|
|
"id" = $1::uuid
|
|
|
|
-- StackRepository.getForAssetRemoval
|
|
select
|
|
"stackId" as "id",
|
|
"stack"."primaryAssetId"
|
|
from
|
|
"asset"
|
|
left join "stack" on "stack"."id" = "asset"."stackId"
|
|
where
|
|
"asset"."id" = $1
|