mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-27 14:02:44 +00:00
Create new projectId_1_threadId_1 index for rooms collection (#23422)
GitOrigin-RevId: 180799e5b045ba7f07e1dbda5b9d25b52741bd14
This commit is contained in:
parent
0eaa0c47e4
commit
32bb4d36bb
1 changed files with 31 additions and 0 deletions
|
@ -0,0 +1,31 @@
|
|||
/* eslint-disable no-unused-vars */
|
||||
|
||||
import Helpers from './lib/helpers.mjs'
|
||||
|
||||
const tags = ['server-ce', 'server-pro', 'saas']
|
||||
|
||||
const indexes = [
|
||||
{
|
||||
key: {
|
||||
project_id: 1,
|
||||
thread_id: 1,
|
||||
},
|
||||
name: 'project_id_1_thread_id_1',
|
||||
},
|
||||
]
|
||||
|
||||
const migrate = async client => {
|
||||
const { db } = client
|
||||
await Helpers.addIndexesToCollection(db.rooms, indexes)
|
||||
}
|
||||
|
||||
const rollback = async client => {
|
||||
const { db } = client
|
||||
await Helpers.dropIndexesFromCollection(db.rooms, indexes)
|
||||
}
|
||||
|
||||
export default {
|
||||
tags,
|
||||
migrate,
|
||||
rollback,
|
||||
}
|
Loading…
Add table
Reference in a new issue