feat: add initial backend and frontend structure with models, DTOs, and WebSocket events
This commit is contained in:
24
apps/backend/prisma/models/message.prisma
Normal file
24
apps/backend/prisma/models/message.prisma
Normal file
@@ -0,0 +1,24 @@
|
||||
// Message model
|
||||
|
||||
enum MessageRole {
|
||||
user
|
||||
assistant
|
||||
system
|
||||
}
|
||||
|
||||
model Message {
|
||||
id String @id @default(uuid())
|
||||
role MessageRole
|
||||
content String
|
||||
tokensUsed Int?
|
||||
model String?
|
||||
metadata Json?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
conversationId String
|
||||
conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([conversationId])
|
||||
@@index([createdAt])
|
||||
@@index([conversationId, createdAt])
|
||||
}
|
||||
Reference in New Issue
Block a user