mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #36833 from overleaf/ii-workspaces-collection
[web] Create workspaces collection indexes GitOrigin-RevId: a84d404e660e6c19eb288712bcf020e1ba4a90d0
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import Helpers from './lib/helpers.mjs'
|
||||
|
||||
const tags = ['saas', 'nonblocking']
|
||||
|
||||
// Every read and write of a workspace looks it up by the subscription that owns
|
||||
// it, so this backs the group settings page. Not unique: a subscription is
|
||||
// allowed several workspaces, even though a group currently gets exactly one.
|
||||
const indexes = [
|
||||
{
|
||||
key: { subscription_id: 1 },
|
||||
name: 'subscription_id_1',
|
||||
},
|
||||
]
|
||||
|
||||
const migrate = async client => {
|
||||
const { db } = client
|
||||
await Helpers.addIndexesToCollection(db.workspaces, indexes)
|
||||
}
|
||||
|
||||
const rollback = async client => {
|
||||
const { db } = client
|
||||
await Helpers.dropIndexesFromCollection(db.workspaces, indexes)
|
||||
}
|
||||
|
||||
export default {
|
||||
tags,
|
||||
migrate,
|
||||
rollback,
|
||||
}
|
||||
@@ -74,6 +74,7 @@ export const db = {
|
||||
tokens: internalDb.collection('tokens'),
|
||||
userAuditLogEntries: internalDb.collection('userAuditLogEntries'),
|
||||
users: internalDb.collection('users'),
|
||||
workspaces: internalDb.collection('workspaces'),
|
||||
onboardingDataCollection: internalDb.collection('onboardingDataCollection'),
|
||||
scriptLogs: internalDb.collection('scriptLogs'),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user