mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
74f44e655a
Move project/user audit logs to their own collections GitOrigin-RevId: f6f89b3e2815c0fe5691a79eceb35b77b3c370d8
22 lines
592 B
JavaScript
22 lines
592 B
JavaScript
const mongoose = require('../infrastructure/Mongoose')
|
|
const { Schema } = mongoose
|
|
|
|
const UserAuditLogEntrySchema = new Schema(
|
|
{
|
|
userId: { type: Schema.Types.ObjectId, index: true },
|
|
info: { type: Object },
|
|
initiatorId: { type: Schema.Types.ObjectId },
|
|
ipAddress: { type: String },
|
|
operation: { type: String },
|
|
timestamp: { type: Date, default: Date.now },
|
|
},
|
|
{
|
|
collection: 'userAuditLogEntries',
|
|
}
|
|
)
|
|
|
|
exports.UserAuditLogEntry = mongoose.model(
|
|
'UserAuditLogEntry',
|
|
UserAuditLogEntrySchema
|
|
)
|
|
exports.UserAuditLogEntrySchema = UserAuditLogEntrySchema
|