overleaf/services/web/migrations/20231030160030_managed_users_enabled.mjs

28 lines
524 B
JavaScript
Raw Normal View History

/* eslint-disable no-unused-vars */
import Helpers from './lib/helpers.mjs'
const tags = ['saas']
const migrate = async client => {
const { db } = client
await db.subscriptions.updateMany(
{ groupPolicy: { $exists: true } },
{ $set: { managedUsersEnabled: true } }
)
}
const rollback = async client => {
const { db } = client
await db.subscriptions.updateMany(
{ groupPolicy: { $exists: true } },
{ $unset: { managedUsersEnabled: '' } }
)
}
export default {
tags,
migrate,
rollback,
}