File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ model User {
290290 chatSessions ChatSession []
291291 chatMessages ChatMessage []
292292 chatToolCalls ChatToolCall []
293+ chatAttachments ChatAttachment []
293294 sentInvitations Invitation [] @relation (" InvitedByUser " )
294295 commentMentions CommentMention [] @relation (" commentMentions " )
295296 notificationPreferences NotificationPreference []
@@ -550,11 +551,30 @@ model ChatMessage {
550551 createdAt DateTime @default (now () )
551552 toolCallRows ChatToolCall []
552553
554+ attachments ChatAttachment []
555+
553556 @@index ([sessionId , createdAt ] )
554557 @@index ([userId , createdAt ] )
555558 @@map (" chat_messages " )
556559}
557560
561+ model ChatAttachment {
562+ id String @id @default (uuid () )
563+ messageId String ?
564+ message ChatMessage ? @relation (fields : [messageId ] , references : [id ] , onDelete : Cascade )
565+ userId String
566+ user User @relation (fields : [userId ] , references : [id ] , onDelete : Cascade )
567+ filename String
568+ mimeType String
569+ url String
570+ size Int
571+ createdAt DateTime @default (now () )
572+
573+ @@index ([messageId ] )
574+ @@index ([userId , createdAt ] )
575+ @@map (" chat_attachments " )
576+ }
577+
558578model ChatToolCall {
559579 id String @id @default (uuid () )
560580 sessionId String
You can’t perform that action at this time.
0 commit comments