feat: add initial backend and frontend structure with models, DTOs, and WebSocket events
This commit is contained in:
56
apps/backend/prisma/models/character.prisma
Normal file
56
apps/backend/prisma/models/character.prisma
Normal file
@@ -0,0 +1,56 @@
|
||||
// Character model and character knowledge
|
||||
|
||||
enum ImportSourceType {
|
||||
file
|
||||
url
|
||||
manual
|
||||
}
|
||||
|
||||
enum ImportStatus {
|
||||
pending
|
||||
processing
|
||||
completed
|
||||
failed
|
||||
}
|
||||
|
||||
model Character {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
avatarUrl String?
|
||||
personalityPrompt String
|
||||
attributes Json @default("{}")
|
||||
config Json @default("{}")
|
||||
isPublic Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
conversations Conversation[]
|
||||
knowledgeSources CharacterKnowledge[]
|
||||
vectorMemories VectorMemory[]
|
||||
|
||||
@@index([userId])
|
||||
@@index([name])
|
||||
}
|
||||
|
||||
model CharacterKnowledge {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
sourceType ImportSourceType
|
||||
sourceName String
|
||||
mimeType String?
|
||||
fileSize BigInt?
|
||||
rawContent String?
|
||||
status ImportStatus @default(pending)
|
||||
processingInfo Json?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
characterId String
|
||||
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
||||
vectorMemories VectorMemory[]
|
||||
|
||||
@@index([characterId])
|
||||
@@index([status])
|
||||
}
|
||||
Reference in New Issue
Block a user