feat: sync memories (#19579)

This commit is contained in:
Jason Rasmussen 2025-06-27 12:20:13 -04:00 committed by GitHub
parent 97aabe466e
commit 6feca56da8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 1482 additions and 203 deletions

View file

@ -652,3 +652,78 @@ where
)
order by
"exif"."updateId" asc
-- SyncRepository.getMemoryUpserts
select
"id",
"createdAt",
"updatedAt",
"deletedAt",
"ownerId",
"type",
"data",
"isSaved",
"memoryAt",
"seenAt",
"showAt",
"hideAt",
"updateId"
from
"memories"
where
"ownerId" = $1
and "updatedAt" < now() - interval '1 millisecond'
order by
"updateId" asc
-- SyncRepository.getMemoryDeletes
select
"id",
"memoryId"
from
"memories_audit"
where
"userId" = $1
and "deletedAt" < now() - interval '1 millisecond'
order by
"id" asc
-- SyncRepository.getMemoryAssetUpserts
select
"memoriesId" as "memoryId",
"assetsId" as "assetId",
"updateId"
from
"memories_assets_assets"
where
"memoriesId" in (
select
"id"
from
"memories"
where
"ownerId" = $1
)
and "updatedAt" < now() - interval '1 millisecond'
order by
"updateId" asc
-- SyncRepository.getMemoryAssetDeletes
select
"id",
"memoryId",
"assetId"
from
"memory_assets_audit"
where
"memoryId" in (
select
"id"
from
"memories"
where
"ownerId" = $1
)
and "deletedAt" < now() - interval '1 millisecond'
order by
"id" asc