Skip to content

High performance self-hosted photo and video management solution.

889 B
Raw Blame
-- 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
order by
  "directoryPath" asc

-- 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