Skip to content

Commit

Permalink
website not working with old schema so changed back to original
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAmaia committed Sep 2, 2024
1 parent a6e5e8c commit 4441fbd
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions convex/schema.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";

// const chatMessageSchema = defineTable({
// msg: v.string(),
// type: v.string(), // Defines whether it's the chatbot or user's message
// });

export default defineSchema({
message: defineTable({
msg: v.string(),
userId: v.string(),
type: v.string(), // defines whether it's the chatbot or user's message
})
.index("byUserId",["userId"]),

// userHistory: defineTable({
users: defineTable({
userName: v.string(),
clerkId: v.string(), // this the Clerk ID, stored in the subject JWT field
chatHistory: v.any(),
// chatHistory: v.array(v.object({
// type: v.string(), // defines whether it's the chatbot or user's message
// text: v.string(),
// })),
chatHistory: v.array(v.object({
type: v.string(), // defines whether it's the chatbot or user's message
text: v.string(),
})),
}).index("byClerkId", ["clerkId"]),

});
});

0 comments on commit 4441fbd

Please sign in to comment.