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

34 lines
846 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
substring("assets"."originalPath", $1) as "directoryPath"
from
"assets"
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
"assets".*,
2025-01-22 15:17:42 -05:00
to_json("exif") as "exifInfo"
2025-01-09 11:15:41 -05:00
from
"assets"
left join "exif" on "assets"."id" = "exif"."assetId"
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
regexp_replace("assets"."originalPath", $5, $6) asc