20260520120000_add_domainVerifications_scheduler_index.mjs 697 B

12345678910111213141516171819202122232425262728293031
  1. /* eslint-disable no-unused-vars */
  2. import Helpers from './lib/helpers.mjs'
  3. const tags = ['saas', 'nonblocking']
  4. // Supports the daily scheduler query in scripts/verify_domains.mjs which
  5. // filters on status and lastVerificationAttemptAt.
  6. const indexes = [
  7. {
  8. key: { status: 1, lastVerificationAttemptAt: 1 },
  9. name: 'status_1_lastVerificationAttemptAt_1',
  10. },
  11. ]
  12. const migrate = async client => {
  13. const { db } = client
  14. await Helpers.addIndexesToCollection(db.domainVerifications, indexes)
  15. }
  16. const rollback = async client => {
  17. const { db } = client
  18. await Helpers.dropIndexesFromCollection(db.domainVerifications, indexes)
  19. }
  20. export default {
  21. tags,
  22. migrate,
  23. rollback,
  24. }