SaraS
Convex Community2y ago
21 replies
Sara

A Bug with adding documents

when I add a new document from the website, about 500 new lines appear in the editing area, it has been Working earlier it is just not working properly now for some reason.
it showed me an error with validating schema earlier in the console but I can't seem to reproduce it.

my schema for refrence:
const schema = defineSchema({
  ...authTables,
  // Your other tables...
  profiles: defineTable({
    userId: v.id('users'), // one to one
    bio: v.string(),
  }).index('userId', ['userId']),
  // one user has many friends but 1 friend is connected to 1 user, one to many
  friends: defineTable({
    userId: v.id('users'),
    friendId:v.id('users'),
  }).index('userId',['userId'],)
  .index('friendId',['friendId']),
  requests: defineTable({
    senderId: v.id('users'),
    receiverId: v.id('users'),
    status:v.string(),
  }).index('senderId',['senderId'])
  .index('receiverId',['receiverId']),
  chats:defineTable({
    name:v.string(),
  }),
  messages:defineTable({
   chatId: v.id("chats"),
   senderId: v.id('users'),
   message: v.string(),
  })
  .index('senderId',['senderId'])
  .index('chatId',['chatId'])
});
 
export default schema;


I should state it's only occurring for the messages table
Was this page helpful?