20250828095305_create_subscription_v1_id_index.mjs 464 B

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