mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-25 02:00:07 +02:00

Revert "Revert "[web] Add group audit log"" GitOrigin-RevId: 4d61cfd9e8a7dac1f5837a4028aff95fa19c308a
35 lines
651 B
JavaScript
35 lines
651 B
JavaScript
/* eslint-disable no-unused-vars */
|
|
|
|
import Helpers from './lib/helpers.mjs'
|
|
|
|
const tags = ['saas']
|
|
|
|
const indexes = [
|
|
{
|
|
key: {
|
|
groupId: 1,
|
|
timestamp: 1,
|
|
},
|
|
name: 'groupId_1_timestamp_1',
|
|
},
|
|
]
|
|
|
|
const migrate = async client => {
|
|
const { db } = client
|
|
await Helpers.addIndexesToCollection(db.groupAuditLogEntries, indexes)
|
|
}
|
|
|
|
const rollback = async client => {
|
|
const { db } = client
|
|
try {
|
|
await Helpers.dropIndexesFromCollection(db.groupAuditLogEntries, indexes)
|
|
} catch (err) {
|
|
console.error('Something went wrong rolling back the migrations', err)
|
|
}
|
|
}
|
|
|
|
export default {
|
|
tags,
|
|
migrate,
|
|
rollback,
|
|
}
|