overleaf/services/web/migrations/20190912145006_create_docOps_indexes.js
Eric Mc Sween d0a9f8c2cb Merge pull request #15748 from overleaf/em-drop-docops-collection
Drop the docOps collection

GitOrigin-RevId: 8ffa0570ae58b6a00412d8953d3ea0fbb1869b69
2024-02-01 09:03:46 +00:00

23 lines
502 B
JavaScript

const Helpers = require('./lib/helpers')
exports.tags = ['server-ce', 'server-pro', 'saas']
const indexes = [
{
unique: true,
key: {
doc_id: 1,
},
name: 'doc_id_1',
},
]
exports.migrate = async ({ nativeDb }) => {
const docOps = nativeDb.collection('docOps')
await Helpers.addIndexesToCollection(docOps, indexes)
}
exports.rollback = async ({ nativeDb }) => {
const docOps = nativeDb.collection('docOps')
await Helpers.dropIndexesFromCollection(docOps, indexes)
}