mirror of
https://github.com/immich-app/immich.git
synced 2025-12-27 09:14:55 +03:00
refactor: migrate audit repository to kysely (#15269)
This commit is contained in:
21
server/src/queries/audit.repository.sql
Normal file
21
server/src/queries/audit.repository.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- NOTE: This file is auto generated by ./sql-generator
|
||||
|
||||
-- AuditRepository.getAfter
|
||||
select distinct
|
||||
on ("audit"."entityId", "audit"."entityType") "audit"."entityId"
|
||||
from
|
||||
"audit"
|
||||
where
|
||||
"audit"."createdAt" > $1
|
||||
and "audit"."action" = $2
|
||||
and "audit"."entityType" = $3
|
||||
and "audit"."ownerId" in ($4)
|
||||
order by
|
||||
"audit"."entityId" desc,
|
||||
"audit"."entityType" desc,
|
||||
"audit"."createdAt" desc
|
||||
|
||||
-- AuditRepository.removeBefore
|
||||
delete from "audit"
|
||||
where
|
||||
"createdAt" < $1
|
||||
Reference in New Issue
Block a user