20260225162503_add_index_domainVerifications.mjs 540 B

1234567891011121314151617181920212223242526272829303132
  1. /* eslint-disable no-unused-vars */
  2. import Helpers from './lib/helpers.mjs'
  3. const tags = ['saas']
  4. const indexes = [
  5. {
  6. key: { domain: 1 },
  7. name: 'domain_1',
  8. unique: true,
  9. },
  10. ]
  11. const migrate = async client => {
  12. const { db } = client
  13. await Helpers.addIndexesToCollection(db.domainVerifications, indexes)
  14. }
  15. const rollback = async client => {
  16. const { db } = client
  17. await Helpers.dropIndexesFromCollection(db.domainVerifications, [
  18. { name: 'domain_1' },
  19. ])
  20. }
  21. export default {
  22. tags,
  23. migrate,
  24. rollback,
  25. }