2023-10-31 07:02:22 -04:00
|
|
|
/* eslint-disable no-unused-vars */
|
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
const Helpers = require('./lib/helpers')
|
2023-10-31 07:02:22 -04:00
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.tags = ['saas']
|
2023-10-31 07:02:22 -04:00
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.migrate = async client => {
|
2023-10-31 07:02:22 -04:00
|
|
|
const { db } = client
|
|
|
|
await db.subscriptions.updateMany(
|
|
|
|
{ groupPolicy: { $exists: true } },
|
|
|
|
{ $set: { managedUsersEnabled: true } }
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.rollback = async client => {
|
2023-10-31 07:02:22 -04:00
|
|
|
const { db } = client
|
|
|
|
await db.subscriptions.updateMany(
|
|
|
|
{ groupPolicy: { $exists: true } },
|
|
|
|
{ $unset: { managedUsersEnabled: '' } }
|
|
|
|
)
|
|
|
|
}
|