feat: Implement analysis job tracking with progress timeline and enhanced data source status management.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user