mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: persistent memories (#15953)
feat: memories refactor chore: use heart as favorite icon fix: linting
This commit is contained in:
parent
502f6e020d
commit
d350022dec
29 changed files with 585 additions and 70 deletions
|
|
@ -1,12 +1,68 @@
|
|||
-- NOTE: This file is auto generated by ./sql-generator
|
||||
|
||||
-- MemoryRepository.cleanup
|
||||
delete from "memories"
|
||||
where
|
||||
"createdAt" < $1
|
||||
and "isSaved" = $2
|
||||
|
||||
-- MemoryRepository.search
|
||||
select
|
||||
*
|
||||
"memories".*,
|
||||
(
|
||||
select
|
||||
coalesce(json_agg(agg), '[]')
|
||||
from
|
||||
(
|
||||
select
|
||||
"assets".*
|
||||
from
|
||||
"assets"
|
||||
inner join "memories_assets_assets" on "assets"."id" = "memories_assets_assets"."assetsId"
|
||||
where
|
||||
"memories_assets_assets"."memoriesId" = "memories"."id"
|
||||
and "assets"."deletedAt" is null
|
||||
) as agg
|
||||
) as "assets"
|
||||
from
|
||||
"memories"
|
||||
where
|
||||
"ownerId" = $1
|
||||
"deletedAt" is null
|
||||
and "ownerId" = $1
|
||||
order by
|
||||
"memoryAt" desc
|
||||
|
||||
-- MemoryRepository.search (date filter)
|
||||
select
|
||||
"memories".*,
|
||||
(
|
||||
select
|
||||
coalesce(json_agg(agg), '[]')
|
||||
from
|
||||
(
|
||||
select
|
||||
"assets".*
|
||||
from
|
||||
"assets"
|
||||
inner join "memories_assets_assets" on "assets"."id" = "memories_assets_assets"."assetsId"
|
||||
where
|
||||
"memories_assets_assets"."memoriesId" = "memories"."id"
|
||||
and "assets"."deletedAt" is null
|
||||
) as agg
|
||||
) as "assets"
|
||||
from
|
||||
"memories"
|
||||
where
|
||||
(
|
||||
"showAt" is null
|
||||
or "showAt" <= $1
|
||||
)
|
||||
and (
|
||||
"hideAt" is null
|
||||
or "hideAt" >= $2
|
||||
)
|
||||
and "deletedAt" is null
|
||||
and "ownerId" = $3
|
||||
order by
|
||||
"memoryAt" desc
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue