Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🗃️ Add user agent, geolocation to audit logs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 7, 2020
1 parent 049e3eb commit e507289
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,22 @@ model webhooks {
}

model auditLogs {
createdAt DateTime @default(now())
event String
id Int @id @default(autoincrement())
group groups @relation("groupAuditLog", fields: [groupId], references: [id])
groupId Int
updatedAt DateTime @updatedAt
user users @relation("userAuditLog", fields: [userId], references: [id])
userId Int
createdAt DateTime @default(now())
event String
id Int @id @default(autoincrement())
group groups @relation("groupAuditLog", fields: [groupId], references: [id])
groupId Int
updatedAt DateTime @updatedAt
user users @relation("userAuditLog", fields: [userId], references: [id])
userId Int
ipAddress String?
userAgent String?
city String?
region String?
timezone String?
countryCode String?
browser String?
operatingSystem String?
@@index([userId], name: "userId")
@@index([groupId], name: "groupId")
Expand Down

0 comments on commit e507289

Please sign in to comment.