feat: Implement analysis job tracking with progress timeline and enhanced data source status management.

This commit is contained in:
2026-02-03 22:43:27 +00:00
parent c47614bc66
commit 358f2a42dd
22 changed files with 2251 additions and 219 deletions

View File

@@ -147,6 +147,50 @@ const schema = defineSchema({
.index("by_project_status", ["projectId", "status"])
.index("by_project_createdAt", ["projectId", "createdAt"])
.index("by_project_url", ["projectId", "url"]),
analysisJobs: defineTable({
projectId: v.id("projects"),
dataSourceId: v.optional(v.id("dataSources")),
status: v.union(
v.literal("pending"),
v.literal("running"),
v.literal("completed"),
v.literal("failed")
),
progress: v.optional(v.number()),
stage: v.optional(v.string()),
timeline: v.optional(v.array(v.object({
key: v.string(),
label: v.string(),
status: v.union(
v.literal("pending"),
v.literal("running"),
v.literal("completed"),
v.literal("failed")
),
detail: v.optional(v.string()),
}))),
error: v.optional(v.string()),
createdAt: v.number(),
updatedAt: v.number(),
})
.index("by_project_status", ["projectId", "status"])
.index("by_project_createdAt", ["projectId", "createdAt"]),
searchJobs: defineTable({
projectId: v.id("projects"),
status: v.union(
v.literal("pending"),
v.literal("running"),
v.literal("completed"),
v.literal("failed")
),
config: v.optional(v.any()),
progress: v.optional(v.number()),
error: v.optional(v.string()),
createdAt: v.number(),
updatedAt: v.number(),
})
.index("by_project_status", ["projectId", "status"])
.index("by_project_createdAt", ["projectId", "createdAt"]),
});
export default schema;