mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
adding DB migration for managedUserEnabled flag (#15516)
GitOrigin-RevId: 82727328d6eb25bb5fe394053beb9d943cd253e9
This commit is contained in:
parent
6906c6a28c
commit
451a6e958f
1 changed files with 21 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
/* 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: '' } }
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue