mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
5bb90dc6cb
[misc] align all the mongodb dependency versions GitOrigin-RevId: 1194fe57601af98bb61250a285bfc85b4b8179dd
30 lines
615 B
JavaScript
30 lines
615 B
JavaScript
import Helpers from './lib/helpers.mjs'
|
|
import { getCollectionInternal } from '../app/src/infrastructure/mongodb.js'
|
|
|
|
const tags = ['server-ce', 'server-pro', 'saas']
|
|
|
|
const indexes = [
|
|
{
|
|
unique: true,
|
|
key: {
|
|
doc_id: 1,
|
|
},
|
|
name: 'doc_id_1',
|
|
},
|
|
]
|
|
|
|
const migrate = async () => {
|
|
const docOps = await getCollectionInternal('docOps')
|
|
await Helpers.addIndexesToCollection(docOps, indexes)
|
|
}
|
|
|
|
const rollback = async () => {
|
|
const docOps = await getCollectionInternal('docOps')
|
|
await Helpers.dropIndexesFromCollection(docOps, indexes)
|
|
}
|
|
|
|
export default {
|
|
tags,
|
|
migrate,
|
|
rollback,
|
|
}
|