mirror of
https://github.com/immich-app/immich.git
synced 2025-11-08 07:43:07 -05:00
34 lines
858 B
SQL
34 lines
858 B
SQL
-- NOTE: This file is auto generated by ./sql-generator
|
|
|
|
-- ViewRepository.getUniqueOriginalPaths
|
|
select distinct
|
|
substring("asset"."originalPath", $1) as "directoryPath"
|
|
from
|
|
"asset"
|
|
where
|
|
"ownerId" = $2::uuid
|
|
and "visibility" = $3
|
|
and "deletedAt" is null
|
|
and "fileCreatedAt" is not null
|
|
and "fileModifiedAt" is not null
|
|
and "localDateTime" is not null
|
|
|
|
-- ViewRepository.getAssetsByOriginalPath
|
|
select
|
|
"asset".*,
|
|
to_json("asset_exif") as "exifInfo"
|
|
from
|
|
"asset"
|
|
left join "asset_exif" on "asset"."id" = "asset_exif"."assetId"
|
|
where
|
|
"ownerId" = $1::uuid
|
|
and "visibility" = $2
|
|
and "deletedAt" is null
|
|
and "fileCreatedAt" is not null
|
|
and "fileModifiedAt" is not null
|
|
and "localDateTime" is not null
|
|
and "originalPath" like $3
|
|
and "originalPath" not like $4
|
|
order by
|
|
regexp_replace("asset"."originalPath", $5, $6) asc
|