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

* [web] fix typo in ESM migration of a db migration * [web] migrate old migration to ESM * [web] use batchedUpdate for bulk updates in old migrations GitOrigin-RevId: a984f785c577c2ac4125c947b8a3efffa57e1eb7
26 lines
465 B
JavaScript
26 lines
465 B
JavaScript
import Helpers from './lib/helpers.mjs'
|
|
|
|
const tags = ['server-ce', 'server-pro', 'saas']
|
|
|
|
const indexes = [
|
|
{
|
|
key: { lastActive: 1 },
|
|
name: 'lastActive_1',
|
|
},
|
|
]
|
|
|
|
async function migrate(client) {
|
|
const { db } = client
|
|
await Helpers.addIndexesToCollection(db.users, indexes)
|
|
}
|
|
|
|
async function rollback(client) {
|
|
const { db } = client
|
|
await Helpers.dropIndexesFromCollection(db.users, indexes)
|
|
}
|
|
|
|
export default {
|
|
tags,
|
|
migrate,
|
|
rollback,
|
|
}
|