overleaf-cep/services/web/migrations/20210310111225_create_deletedFiles_projectId_index.mjs
Jakob Ackermann 11b94593c2 [web] remove deledFiles collection (#25750)
* [history-v1] remove processing of deleted files when back-filling hashes

* [web] remove deledFiles collection

GitOrigin-RevId: 7c080e564f7d7acb33ebe7ebe012f415a847d0df
2025-05-23 08:05:01 +00:00

32 lines
726 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 = [
{
key: {
projectId: 1,
},
name: 'projectId_1',
},
]
async function getCollection() {
// NOTE: The deletedFiles collection is not available to the application as it has been retired. Fetch it here.
return await getCollectionInternal('deletedFiles')
}
const migrate = async () => {
await Helpers.addIndexesToCollection(await getCollection(), indexes)
}
const rollback = async () => {
await Helpers.dropIndexesFromCollection(await getCollection(), indexes)
}
export default {
tags,
migrate,
rollback,
}