Add AuditLog table and Prisma audit extension
This commit is contained in:
@@ -229,3 +229,27 @@ model ColorPalette {
|
||||
|
||||
@@map("ColorPalette")
|
||||
}
|
||||
|
||||
// Append-only audit trail of database mutations. Written centrally by the
|
||||
// Prisma extension in src/lib/db.ts; read by the admin Audit Log page.
|
||||
model AuditLog {
|
||||
id String @id @default(uuid())
|
||||
createdAt DateTime @default(now())
|
||||
userId String?
|
||||
email String?
|
||||
roleId Int?
|
||||
roleName String?
|
||||
page String
|
||||
action String
|
||||
entity String?
|
||||
entityId String?
|
||||
before Json?
|
||||
after Json?
|
||||
ip String?
|
||||
|
||||
@@index([createdAt])
|
||||
@@index([roleId])
|
||||
@@index([action])
|
||||
@@index([page])
|
||||
@@map("AuditLog")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user