Files
code-center/convex/schema.ts
2026-01-26 02:44:17 +08:00

30 lines
803 B
TypeScript

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"]),
});