feat: combine with handleSidecarCheck

This commit is contained in:
Jonathan Jogenfors 2025-08-27 15:14:27 +02:00
parent 65f63be564
commit a29516d8ad

View File

@ -21,6 +21,22 @@ limit
select
"id",
"originalPath",
(
select
coalesce(json_agg(agg), '[]')
from
(
select
"asset_file"."id",
"asset_file"."path",
"asset_file"."type"
from
"asset_file"
where
"asset_file"."assetId" = "asset"."id"
and "asset_file"."type" = $1
) as agg
) as "files",
(
select
coalesce(json_agg(agg), '[]')
@ -34,7 +50,18 @@ select
where
"asset"."id" = "tag_asset"."assetsId"
) as agg
) as "tags",
) as "tags"
from
"asset"
where
"asset"."id" = $2::uuid
limit
$3
-- AssetJobRepository.getForSidecarCheckJob
select
"id",
"originalPath",
(
select
coalesce(json_agg(agg), '[]')
@ -48,23 +75,10 @@ select
"asset_file"
where
"asset_file"."assetId" = "asset"."id"
and "asset_file"."type" = $1
) as agg
) as "files"
from
"asset"
where
"asset"."id" = $2::uuid
limit
$3
-- AssetJobRepository.getForSidecarCheckJob
select
"id",
"sidecarPath",
"originalPath"
from
"asset"
where
"asset"."id" = $1::uuid
limit