refactor: dedicated query for asset migration job (#17631)

This commit is contained in:
Daniel Dietzler 2025-04-15 21:49:15 +02:00 committed by GitHub
parent 26f0ea4cb5
commit 21becbf1b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 54 additions and 9 deletions

View file

@ -90,6 +90,31 @@ where
or "assets"."thumbhash" is null
)
-- AssetJobRepository.getForMigrationJob
select
"assets"."id",
"assets"."ownerId",
"assets"."encodedVideoPath",
(
select
coalesce(json_agg(agg), '[]')
from
(
select
"asset_files"."id",
"asset_files"."path",
"asset_files"."type"
from
"asset_files"
where
"asset_files"."assetId" = "assets"."id"
) as agg
) as "files"
from
"assets"
where
"assets"."id" = $1
-- AssetJobRepository.getForStorageTemplateJob
select
"assets"."id",