overleaf-cep/services/web/migrations/20250206103037_create_rooms_projectId_threadId_index.mjs
Domagoj Kriskovic 32bb4d36bb Create new projectId_1_threadId_1 index for rooms collection (#23422)
GitOrigin-RevId: 180799e5b045ba7f07e1dbda5b9d25b52741bd14
2025-02-11 09:04:42 +00:00

31 lines
547 B
JavaScript

/* 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,
}