39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
// 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])
|
|
}
|