Files
overleaf-cep/tools/migrations/20260520120000_add_domainVerifications_scheduler_index.mjs
Kate Crichton f7b1ccae9a Merge pull request #33852 from overleaf/kc-schedule-domain-verification
[web] schedule domain reverification

GitOrigin-RevId: 08217692960379d0a6f7ce457032b1182fb2bf4e
2026-06-19 08:06:30 +00:00

32 lines
697 B
JavaScript

/* eslint-disable no-unused-vars */
import Helpers from './lib/helpers.mjs'
const tags = ['saas', 'nonblocking']
// Supports the daily scheduler query in scripts/verify_domains.mjs which
// filters on status and lastVerificationAttemptAt.
const indexes = [
{
key: { status: 1, lastVerificationAttemptAt: 1 },
name: 'status_1_lastVerificationAttemptAt_1',
},
]
const migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.domainVerifications, indexes)
}
const rollback = async client => {
const { db } = client
await Helpers.dropIndexesFromCollection(db.domainVerifications, indexes)
}
export default {
tags,
migrate,
rollback,
}