mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 17:25:11 +03:00
* feat: notifications * UI works * chore: pr feedback * initial fetch and clear notification upon logging out * fix: merge --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
59 lines
836 B
SQL
59 lines
836 B
SQL
-- NOTE: This file is auto generated by ./sql-generator
|
|
|
|
-- NotificationRepository.cleanup
|
|
delete from "notifications"
|
|
where
|
|
(
|
|
(
|
|
"deletedAt" is not null
|
|
and "deletedAt" < $1
|
|
)
|
|
or (
|
|
"readAt" > $2
|
|
and "createdAt" < $3
|
|
)
|
|
or (
|
|
"readAt" = $4
|
|
and "createdAt" < $5
|
|
)
|
|
)
|
|
|
|
-- NotificationRepository.search
|
|
select
|
|
"id",
|
|
"createdAt",
|
|
"level",
|
|
"type",
|
|
"title",
|
|
"description",
|
|
"data",
|
|
"readAt"
|
|
from
|
|
"notifications"
|
|
where
|
|
"userId" = $1
|
|
and "deletedAt" is null
|
|
order by
|
|
"createdAt" desc
|
|
|
|
-- NotificationRepository.search (unread)
|
|
select
|
|
"id",
|
|
"createdAt",
|
|
"level",
|
|
"type",
|
|
"title",
|
|
"description",
|
|
"data",
|
|
"readAt"
|
|
from
|
|
"notifications"
|
|
where
|
|
(
|
|
"userId" = $1
|
|
and "readAt" is null
|
|
)
|
|
and "deletedAt" is null
|
|
order by
|
|
"createdAt" desc
|