This commit is contained in:
lendry
2026-06-26 17:49:22 +03:00
parent c23f35e732
commit 4e853f8041
17 changed files with 1547 additions and 167 deletions

View File

@@ -408,6 +408,7 @@ model ChatRoom {
group FamilyGroup @relation(fields: [groupId], references: [id], onDelete: Cascade)
members ChatRoomMember[]
messages ChatMessage[]
botChats BotChat[]
@@index([groupId, type])
@@index([groupId, type, peerUserId])
@@ -571,19 +572,23 @@ model BotChat {
id String @id @default(uuid())
botId String
recipientUserId String?
roomId String?
telegramChatId BigInt
chatType String @default("private")
nextInboundMessageId Int @default(1)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
room ChatRoom? @relation(fields: [roomId], references: [id], onDelete: Cascade)
messages BotMessage[]
inboundMessages BotInboundMessage[]
menuButton ChatMenuButton?
@@unique([botId, recipientUserId])
@@unique([botId, roomId])
@@unique([botId, telegramChatId])
@@index([botId])
@@index([roomId])
}
model ChatMenuButton {