20251103164405_subscriptions_ssoConfig_index.mjs 528 B

1234567891011121314151617181920212223242526272829
  1. import Helpers from './lib/helpers.mjs'
  2. const tags = ['saas']
  3. const indexes = [
  4. {
  5. name: 'ssoConfig_1',
  6. key: { ssoConfig: 1 },
  7. partialFilterExpression: {
  8. ssoConfig: { $exists: true },
  9. },
  10. },
  11. ]
  12. const migrate = async client => {
  13. const { db } = client
  14. await Helpers.addIndexesToCollection(db.subscriptions, indexes)
  15. }
  16. const rollback = async client => {
  17. const { db } = client
  18. await Helpers.dropIndexesFromCollection(db.subscriptions, indexes)
  19. }
  20. export default {
  21. tags,
  22. migrate,
  23. rollback,
  24. }