Files
immich/server/src/queries/view.repository.sql

34 lines
858 B
MySQL
Raw Normal View History

-- NOTE: This file is auto generated by ./sql-generator
2025-01-09 11:15:41 -05:00
-- ViewRepository.getUniqueOriginalPaths
select distinct
2025-07-14 10:13:06 -04:00
substring("asset"."originalPath", $1) as "directoryPath"
2025-01-09 11:15:41 -05:00
from
2025-07-14 10:13:06 -04:00
"asset"
2025-01-09 11:15:41 -05:00
where
"ownerId" = $2::uuid
and "visibility" = $3
2025-01-09 11:15:41 -05:00
and "deletedAt" is null
2025-02-20 16:28:30 +01:00
and "fileCreatedAt" is not null
and "fileModifiedAt" is not null
and "localDateTime" is not null
2025-01-09 11:15:41 -05:00
-- ViewRepository.getAssetsByOriginalPath
2025-01-09 11:15:41 -05:00
select
2025-07-14 10:13:06 -04:00
"asset".*,
to_json("asset_exif") as "exifInfo"
2025-01-09 11:15:41 -05:00
from
2025-07-14 10:13:06 -04:00
"asset"
left join "asset_exif" on "asset"."id" = "asset_exif"."assetId"
2025-01-09 11:15:41 -05:00
where
"ownerId" = $1::uuid
and "visibility" = $2
2025-01-09 11:15:41 -05:00
and "deletedAt" is null
2025-02-20 16:28:30 +01:00
and "fileCreatedAt" is not null
and "fileModifiedAt" is not null
and "localDateTime" is not null
and "originalPath" like $3
and "originalPath" not like $4
2025-01-09 11:15:41 -05:00
order by
2025-07-14 10:13:06 -04:00
regexp_replace("asset"."originalPath", $5, $6) asc