From e5072898d3c4bc2dd8c1de982270fb19c6754f48 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Sat, 7 Nov 2020 14:49:11 +0530 Subject: [PATCH] :card_file_box: Add user agent, geolocation to audit logs --- prisma/schema.prisma | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f09f1ae56..405d509c0 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -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")