feat(db): download_task 增加缺席记录与代数字段(迁移 0067)

missing_since / missing_count 记录 qB 里连续查不到的起点与轮数;generation 记录 removed 行复活次数,用于完成事件幂等键换代。contracts DownloadTask 同步为可选字段。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-03 21:20:08 +08:00
1 parent 00045a24cb
commit 3904abc472
3 files changed
+33

No files matched your search

+5
View File
@@ -223,6 +223,11 @@ export const DownloadTask = EntityBase.extend({
removedAt: Timestamp.nullable(),
fileList: z.array(z.object({ path: z.string(), size: NonNegInt, progress: z.number().optional() })).nullable(),
lastError: JsonObject.nullable(),
/** 下载器里连续查不到的起点与轮数:达到阈值才判 removed,中途出现即清零 */
missingSince: Timestamp.nullable().optional(),
missingCount: NonNegInt.optional(),
/** removed 行被再次提交 / 接管复活的次数(完成事件幂等键随之换代) */
generation: NonNegInt.optional(),
});
export type DownloadTask = z.infer<typeof DownloadTask>;
export const DownloadTaskCreate = DownloadTask.pick({