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

22 lines
480 B
JavaScript
Raw Normal View History

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