From c0647382cd63d046fee893ea0ee69503484d19f6 Mon Sep 17 00:00:00 2001 From: Yaros Date: Sat, 15 Aug 2026 11:36:02 +0200 Subject: [PATCH] chore(server): AssetOcrSyncReset.ts --- .../migrations/1786716028459-AssetOcrSyncReset.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 server/src/schema/migrations/1786716028459-AssetOcrSyncReset.ts diff --git a/server/src/schema/migrations/1786716028459-AssetOcrSyncReset.ts b/server/src/schema/migrations/1786716028459-AssetOcrSyncReset.ts new file mode 100644 index 0000000000..767778e6a1 --- /dev/null +++ b/server/src/schema/migrations/1786716028459-AssetOcrSyncReset.ts @@ -0,0 +1,12 @@ +import { Kysely, sql } from 'kysely'; + +export async function up(db: Kysely): Promise { + // OCR visibility updates did not bump updateId before the asset_ocr_updatedAt trigger was added, + // so clients never received those changes. There is no way to know which rows were missed, so + // reset the checkpoint to backfill all OCR rows on the next sync. + await sql`DELETE FROM session_sync_checkpoint WHERE type = 'AssetOcrV1'`.execute(db); +} + +export async function down(): Promise { + // Not implemented +}