20230928092537_backfill_subscriptions_managed_users_feature_flag.js 426 B

1234567891011121314151617
  1. exports.tags = ['saas']
  2. exports.migrate = async client => {
  3. const { db } = client
  4. await db.subscriptions.updateMany(
  5. { 'features.managedUsers': { $ne: true } },
  6. { $set: { 'features.managedUsers': null } }
  7. )
  8. }
  9. exports.rollback = async client => {
  10. const { db } = client
  11. await db.subscriptions.updateMany(
  12. { 'features.managedUsers': { $eq: null } },
  13. { $set: { 'features.managedUsers': false } }
  14. )
  15. }