add convex

This commit is contained in:
2026-01-26 02:44:17 +08:00
parent 9ff4057166
commit a9d725eb29
11 changed files with 757 additions and 0 deletions

30
convex/schema.ts Normal file
View File

@@ -0,0 +1,30 @@
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
export default defineSchema({
// Other tables here...
github_starred: defineTable({
author: v.string(),
auto: v.string(),
description: v.string(),
last_updated: v.string(),
link: v.string(),
repo_id: v.float64(),
stars: v.float64(),
summary: v.string(),
title: v.string(),
}),
users: defineTable({
userId: v.string(), // 外部系统的用户 ID
name: v.string(),
createdAt: v.string(),
lastLoginAt: v.optional(v.string()),
}).index("userId", ["userId"]),
sessions: defineTable({
userId: v.id("users"),
createdAt: v.string(),
expiresAt: v.optional(v.string()),
token: v.optional(v.string()),
}).index("token", ["token"]),
});