Files
convex/convex/schema.ts

30 lines
891 B
TypeScript

import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
export default defineSchema({
// Other tables here...
github_starred: defineTable({
repo_id: v.number(),
title: v.string(),
description: v.string(),
author: v.string(),
stars: v.number(),
last_updated: v.string(),
link: v.string(),
auto: v.optional(v.string()),
summary: v.optional(v.string()),
}).index("by_repo_id", ["repo_id"])
.index("by_title", ["title"]),
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"]),
});