lots of changes

This commit is contained in:
2026-02-04 11:18:33 +00:00
parent d02d95e680
commit 4fdbfb0fb3
30 changed files with 1796 additions and 822 deletions

View File

@@ -138,6 +138,7 @@ const schema = defineSchema({
opportunities: defineTable({
projectId: v.id("projects"),
analysisId: v.optional(v.id("analyses")),
searchJobId: v.optional(v.id("searchJobs")),
url: v.string(),
platform: v.string(),
title: v.string(),
@@ -145,6 +146,8 @@ const schema = defineSchema({
relevanceScore: v.number(),
intent: v.string(),
status: v.string(),
sentAt: v.optional(v.number()),
archivedAt: v.optional(v.number()),
suggestedApproach: v.string(),
matchedKeywords: v.array(v.string()),
matchedProblems: v.array(v.string()),
@@ -156,7 +159,14 @@ const schema = defineSchema({
})
.index("by_project_status", ["projectId", "status"])
.index("by_project_createdAt", ["projectId", "createdAt"])
.index("by_project_url", ["projectId", "url"]),
.index("by_project_url", ["projectId", "url"])
.index("by_project_searchJob", ["projectId", "searchJobId"]),
userActivity: defineTable({
userId: v.id("users"),
lastActiveDate: v.string(),
streak: v.number(),
updatedAt: v.number(),
}).index("by_user", ["userId"]),
seenUrls: defineTable({
projectId: v.id("projects"),
url: v.string(),
@@ -193,7 +203,8 @@ const schema = defineSchema({
updatedAt: v.number(),
})
.index("by_project_status", ["projectId", "status"])
.index("by_project_createdAt", ["projectId", "createdAt"]),
.index("by_project_createdAt", ["projectId", "createdAt"])
.index("by_dataSource_createdAt", ["dataSourceId", "createdAt"]),
searchJobs: defineTable({
projectId: v.id("projects"),
status: v.union(