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 +}