Merge pull request #9617 from overleaf/msm-audit-log-collections

Move project/user audit logs to their own collections

GitOrigin-RevId: f6f89b3e2815c0fe5691a79eceb35b77b3c370d8
This commit is contained in:
Miguel Serrano
2022-09-29 11:47:50 +02:00
committed by Copybot
parent 9c7aa36e7e
commit 694cb665da
19 changed files with 298 additions and 156 deletions
@@ -0,0 +1,21 @@
const mongoose = require('../infrastructure/Mongoose')
const { Schema } = mongoose
const ProjectAuditLogEntrySchema = new Schema(
{
projectId: { type: Schema.Types.ObjectId, index: true },
operation: { type: String },
initiatorId: { type: Schema.Types.ObjectId },
timestamp: { type: Date, default: Date.now },
info: { type: Object },
},
{
collection: 'projectAuditLogEntries',
}
)
exports.ProjectAuditLogEntry = mongoose.model(
'ProjectAuditLogEntry',
ProjectAuditLogEntrySchema
)
exports.ProjectAuditLogEntrySchema = ProjectAuditLogEntrySchema