mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 15:10:48 +02:00
Merge pull request #28161 from overleaf/bg-improved-index-for-lastBackedUpVersion
add improved index for null search on lastBackedUpVersion GitOrigin-RevId: b938c3607b571053fe69d4a9330e8592c9f4ad02
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
import Helpers from './lib/helpers.mjs'
|
||||
|
||||
const tags = ['saas']
|
||||
|
||||
const indexes = [
|
||||
{
|
||||
key: { 'overleaf.backup.lastBackedUpVersion': 1, _id: 1 },
|
||||
name: 'overleaf.backup.id_1_lastBackedUpVersion_id_1',
|
||||
partialFilterExpression: {
|
||||
'overleaf.backup.lastBackedUpVersion': { $in: [null] },
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
const migrate = async client => {
|
||||
const { db } = client
|
||||
await Helpers.addIndexesToCollection(db.projects, indexes)
|
||||
}
|
||||
|
||||
const rollback = async client => {
|
||||
const { db } = client
|
||||
await Helpers.dropIndexesFromCollection(db.projects, indexes)
|
||||
}
|
||||
|
||||
export default {
|
||||
tags,
|
||||
migrate,
|
||||
rollback,
|
||||
}
|
||||
Reference in New Issue
Block a user