refactor: migrate audit repository to kysely (#15269)

This commit is contained in:
Daniel Dietzler
2025-01-14 03:23:12 +01:00
committed by GitHub
parent b74f013b53
commit 28b08ed417
2 changed files with 44 additions and 16 deletions

View 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