2025-02-04 16:07:41 +01:00
|
|
|
-- NOTE: This file is auto generated by ./sql-generator
|
|
|
|
|
|
|
|
|
|
-- MapRepository.getMapMarkers
|
|
|
|
|
select
|
|
|
|
|
"id",
|
2025-07-14 10:13:06 -04:00
|
|
|
"asset_exif"."latitude" as "lat",
|
|
|
|
|
"asset_exif"."longitude" as "lon",
|
|
|
|
|
"asset_exif"."city",
|
|
|
|
|
"asset_exif"."state",
|
|
|
|
|
"asset_exif"."country"
|
2025-02-04 16:07:41 +01:00
|
|
|
from
|
2025-07-14 10:13:06 -04:00
|
|
|
"asset"
|
|
|
|
|
inner join "asset_exif" on "asset"."id" = "asset_exif"."assetId"
|
|
|
|
|
and "asset_exif"."latitude" is not null
|
|
|
|
|
and "asset_exif"."longitude" is not null
|
2025-02-04 16:07:41 +01:00
|
|
|
where
|
2025-07-14 10:13:06 -04:00
|
|
|
"asset"."visibility" = $1
|
2025-02-04 16:07:41 +01:00
|
|
|
and "deletedAt" is null
|
2025-02-21 15:32:08 +03:00
|
|
|
and (
|
|
|
|
|
"ownerId" in ($2)
|
|
|
|
|
or exists (
|
|
|
|
|
select
|
|
|
|
|
from
|
2025-07-14 10:13:06 -04:00
|
|
|
"album_asset"
|
2025-02-21 15:32:08 +03:00
|
|
|
where
|
2025-07-14 10:13:06 -04:00
|
|
|
"asset"."id" = "album_asset"."assetsId"
|
|
|
|
|
and "album_asset"."albumsId" in ($3)
|
2025-02-21 15:32:08 +03:00
|
|
|
)
|
|
|
|
|
)
|
2025-02-04 16:07:41 +01:00
|
|
|
order by
|
|
|
|
|
"fileCreatedAt" desc
|