2023-10-31 07:02:22 -04:00
|
|
|
/* eslint-disable no-unused-vars */
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
import Helpers from './lib/helpers.mjs'
|
2023-10-31 07:02:22 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = ['saas']
|
2023-10-31 07:02:22 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const 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-02 05:32:13 -04:00
|
|
|
const rollback = async client => {
|
2023-10-31 07:02:22 -04:00
|
|
|
const { db } = client
|
|
|
|
await db.subscriptions.updateMany(
|
|
|
|
{ groupPolicy: { $exists: true } },
|
|
|
|
{ $unset: { managedUsersEnabled: '' } }
|
|
|
|
)
|
|
|
|
}
|
2024-10-02 05:32:13 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
tags,
|
|
|
|
migrate,
|
|
|
|
rollback,
|
|
|
|
}
|