overleaf/services/web/migrations/20210310111225_create_deletedFiles_projectId_index.mjs

29 lines
490 B
JavaScript
Raw Normal View History

import Helpers from './lib/helpers.mjs'
const tags = ['server-ce', 'server-pro', 'saas']
const indexes = [
{
key: {
projectId: 1,
},
name: 'projectId_1',
},
]
const migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.deletedFiles, indexes)
}
const rollback = async client => {
const { db } = client
await Helpers.dropIndexesFromCollection(db.deletedFiles, indexes)
}
export default {
tags,
migrate,
rollback,
}