mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[web] Add expiration for groupAuditLogEntries collection (#27437)
Set to 2.5 years, same as user/project audit logs GitOrigin-RevId: d3b7e6d752eda4b224068e7b37276e79b4143464
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import Helpers from './lib/helpers.mjs'
|
||||
|
||||
const tags = ['saas']
|
||||
|
||||
const indexes = [
|
||||
{
|
||||
// expire after 2.5 years
|
||||
expireAfterSeconds: 60 * 60 * 24 * 365 * 2.5,
|
||||
key: {
|
||||
timestamp: 1,
|
||||
},
|
||||
name: 'timestamp_1',
|
||||
},
|
||||
]
|
||||
|
||||
const migrate = async client => {
|
||||
const { db } = client
|
||||
await Helpers.addIndexesToCollection(db.groupAuditLogEntries, indexes)
|
||||
}
|
||||
|
||||
const rollback = async client => {
|
||||
const { db } = client
|
||||
await Promise.all([
|
||||
Helpers.dropIndexesFromCollection(db.groupAuditLogEntries, indexes),
|
||||
])
|
||||
}
|
||||
|
||||
export default {
|
||||
tags,
|
||||
migrate,
|
||||
rollback,
|
||||
}
|
||||
Reference in New Issue
Block a user