mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Adds deleted filter to docs index
GitOrigin-RevId: bd00fa383946c3a2aa7b03f355aad399bbe9cdca
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import Helpers from './lib/helpers.mjs'
|
||||
|
||||
const tags = ['server-ce', 'server-pro', 'saas']
|
||||
|
||||
const oldIndex = {
|
||||
key: { project_id: 1, inS3: 1 },
|
||||
name: 'project_id_1_inS3_1',
|
||||
}
|
||||
|
||||
const newIndex = {
|
||||
key: { project_id: 1, inS3: 1, deleted: 1 },
|
||||
name: 'project_id_1_inS3_1_deleted_1',
|
||||
}
|
||||
|
||||
const migrate = async client => {
|
||||
const { db } = client
|
||||
await Helpers.addIndexesToCollection(db.docs, [newIndex])
|
||||
await Helpers.dropIndexesFromCollection(db.docs, [oldIndex])
|
||||
}
|
||||
|
||||
const rollback = async client => {
|
||||
const { db } = client
|
||||
await Helpers.addIndexesToCollection(db.docs, [oldIndex])
|
||||
await Helpers.dropIndexesFromCollection(db.docs, [newIndex])
|
||||
}
|
||||
|
||||
export default {
|
||||
tags,
|
||||
migrate,
|
||||
rollback,
|
||||
}
|
||||
Reference in New Issue
Block a user