mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23: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:
@@ -123,6 +123,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'),
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import mongoose from '../infrastructure/Mongoose.mjs'
|
||||
|
||||
const { Schema } = mongoose
|
||||
|
||||
export const MAX_WORKSPACE_NAME_LENGTH = 150
|
||||
|
||||
export const WorkspaceSchema = new Schema(
|
||||
{
|
||||
subscription_id: {
|
||||
type: Schema.Types.ObjectId,
|
||||
required: true,
|
||||
index: true,
|
||||
},
|
||||
name: { type: String, maxlength: MAX_WORKSPACE_NAME_LENGTH },
|
||||
privilegeLevel: {
|
||||
type: String,
|
||||
enum: ['readOnly', 'review', 'readAndWrite'],
|
||||
default: 'readOnly',
|
||||
},
|
||||
},
|
||||
{
|
||||
collection: 'workspaces',
|
||||
minimize: false,
|
||||
}
|
||||
)
|
||||
|
||||
export const Workspace = mongoose.model('Workspace', WorkspaceSchema)
|
||||
Reference in New Issue
Block a user