overleaf/services/web/migrations/20231030160030_managed_users_enabled.js
Davinder Singh 451a6e958f adding DB migration for managedUserEnabled flag (#15516)
GitOrigin-RevId: 82727328d6eb25bb5fe394053beb9d943cd253e9
2023-11-01 09:02:57 +00:00

21 lines
480 B
JavaScript

/* 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: '' } }
)
}