From 7ce6068757c264fd9d65792f0e15a1c0752975f7 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 15 Jun 2026 12:12:14 -0700 Subject: [PATCH] fix migration --- .../src/db/migration/0008_backfillMonitorLastEvaluatedAt.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/db/migration/0008_backfillMonitorLastEvaluatedAt.ts b/server/src/db/migration/0008_backfillMonitorLastEvaluatedAt.ts index 8f8de7308..3ab52f581 100644 --- a/server/src/db/migration/0008_backfillMonitorLastEvaluatedAt.ts +++ b/server/src/db/migration/0008_backfillMonitorLastEvaluatedAt.ts @@ -3,6 +3,8 @@ import { logger } from "@/utils/logger.js"; /** * Backfill lastEvaluatedAt on monitors created before the lastEvaluatedAt existed. + * + * Stamp the upgrade moment, not 0. If set to 0, all checks will be replayed */ export async function backfillMonitorLastEvaluatedAt(): Promise { const SERVICE_NAME = "Migration:BackfillMonitorLastEvaluatedAt"; @@ -10,7 +12,7 @@ export async function backfillMonitorLastEvaluatedAt(): Promise { try { logger.info({ service: SERVICE_NAME, message: "Starting lastEvaluatedAt backfill" }); - const result = await MonitorModel.updateMany({ lastEvaluatedAt: { $exists: false } }, { $set: { lastEvaluatedAt: 0 } }); + const result = await MonitorModel.updateMany({ lastEvaluatedAt: { $exists: false } }, { $set: { lastEvaluatedAt: Date.now() } }); logger.info({ service: SERVICE_NAME,