From 933a0d22eb601febe382f1401a2a6a313bff06d9 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Mon, 7 Nov 2022 11:43:47 +0100 Subject: [PATCH] Merge pull request #9995 from overleaf/msm-cleanup-old-audit-log Cleanup `auditLog` from `users` and `projects` collections GitOrigin-RevId: 2ea6d547837441c5e0391542c80c01bb5b6710fe --- services/web/app/src/models/Project.js | 9 --------- services/web/app/src/models/User.js | 11 ----------- 2 files changed, 20 deletions(-) diff --git a/services/web/app/src/models/Project.js b/services/web/app/src/models/Project.js index adf5fde64b..b8160fc32e 100644 --- a/services/web/app/src/models/Project.js +++ b/services/web/app/src/models/Project.js @@ -24,14 +24,6 @@ const DeletedFileSchema = new Schema({ deletedAt: { type: Date }, }) -const AuditLogEntrySchema = new Schema({ - _id: false, - operation: { type: String }, - initiatorId: { type: Schema.Types.ObjectId }, - timestamp: { type: Date }, - info: { type: Object }, -}) - const ProjectSchema = new Schema({ name: { type: String, default: 'new project' }, lastUpdated: { @@ -116,7 +108,6 @@ const ProjectSchema = new Schema({ }, }, ], - auditLog: [AuditLogEntrySchema], deferredTpdsFlushCounter: { type: Number }, }) diff --git a/services/web/app/src/models/User.js b/services/web/app/src/models/User.js index 89f6293000..16c2698f1f 100644 --- a/services/web/app/src/models/User.js +++ b/services/web/app/src/models/User.js @@ -7,16 +7,6 @@ const { ObjectId } = Schema // See https://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address/574698#574698 const MAX_EMAIL_LENGTH = 254 -const AuditLogEntrySchema = new Schema({ - _id: false, - info: { type: Object }, - initiatorId: { type: Schema.Types.ObjectId }, - ipAddress: { type: String }, - operation: { type: String }, - userId: { type: Schema.Types.ObjectId }, - timestamp: { type: Date }, -}) - const UserSchema = new Schema({ email: { type: String, default: '', maxlength: MAX_EMAIL_LENGTH }, emails: [ @@ -180,7 +170,6 @@ const UserSchema = new Schema({ secret: { type: String }, }, onboardingEmailSentAt: { type: Date }, - auditLog: [AuditLogEntrySchema], splitTests: Schema.Types.Mixed, analyticsId: { type: String }, surveyResponses: Schema.Types.Mixed,