feat: add initial backend and frontend structure with models, DTOs, and WebSocket events
This commit is contained in:
38
apps/backend/prisma/models/conversation.prisma
Normal file
38
apps/backend/prisma/models/conversation.prisma
Normal file
@@ -0,0 +1,38 @@
|
||||
// Conversation and participant models
|
||||
|
||||
model Conversation {
|
||||
id String @id @default(uuid())
|
||||
title String?
|
||||
messageCount Int @default(0)
|
||||
totalTokens Int @default(0)
|
||||
settings Json @default("{}")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
characterId String
|
||||
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
||||
messages Message[]
|
||||
vectorMemories VectorMemory[]
|
||||
storyBranches StoryBranch[]
|
||||
participants ConversationParticipant[]
|
||||
|
||||
@@index([userId])
|
||||
@@index([characterId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
model ConversationParticipant {
|
||||
id String @id @default(uuid())
|
||||
isActive Boolean @default(true)
|
||||
autoRespond Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
conversationId String
|
||||
conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
|
||||
characterId String
|
||||
|
||||
@@unique([conversationId, characterId])
|
||||
@@index([conversationId])
|
||||
}
|
||||
Reference in New Issue
Block a user