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

* [history-v1] remove processing of deleted files when back-filling hashes * [web] remove deledFiles collection GitOrigin-RevId: 7c080e564f7d7acb33ebe7ebe012f415a847d0df
32 lines
726 B
JavaScript
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,
|
|
}
|