-- @query photo_path_lookup_by_local_id
-- @db localContent 32.0
-- @param localId INT
SELECT h.ItemPath
FROM localContent.ItemMetadata im
JOIN localContent.ItemHierarchyView h ON h.FileSystemID = im.FileSystemID
WHERE im.LocalID = ?localId
  AND im.Tombstoned = 0
LIMIT 1
