mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 01:11:36 +03:00
chore: no sql generation for queries with side effects (#18301)
no sql generation for queries with side effects
This commit is contained in:
@@ -432,3 +432,34 @@ where
|
||||
and "assets"."updatedAt" > $3
|
||||
limit
|
||||
$4
|
||||
|
||||
-- AssetRepository.detectOfflineExternalAssets
|
||||
update "assets"
|
||||
set
|
||||
"isOffline" = $1,
|
||||
"deletedAt" = $2
|
||||
where
|
||||
"isOffline" = $3
|
||||
and "isExternal" = $4
|
||||
and "libraryId" = $5::uuid
|
||||
and (
|
||||
not "originalPath" like $6
|
||||
or "originalPath" like $7
|
||||
)
|
||||
|
||||
-- AssetRepository.filterNewExternalAssetPaths
|
||||
select
|
||||
"path"
|
||||
from
|
||||
unnest(array[$1]::text[]) as "path"
|
||||
where
|
||||
not exists (
|
||||
select
|
||||
"originalPath"
|
||||
from
|
||||
"assets"
|
||||
where
|
||||
"assets"."originalPath" = "path"
|
||||
and "libraryId" = $2::uuid
|
||||
and "isExternal" = $3
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user