Add mentions, pin messages and conversations, and search within chats
This commit is contained in:
@@ -210,6 +210,8 @@ model Organization {
|
||||
conversationSettings ConversationSettings?
|
||||
conversationRooms ConversationRoom[]
|
||||
conversationHiddenMessages ConversationHiddenMessage[]
|
||||
conversationPinnedMessages ConversationPinnedMessage[]
|
||||
conversationRoomUserPins ConversationRoomUserPin[]
|
||||
}
|
||||
|
||||
model User {
|
||||
@@ -2113,3 +2115,32 @@ model ConversationHiddenMessage {
|
||||
@@unique([organizationId, externalRoomId, messageId, scope, hiddenByUserId])
|
||||
@@index([organizationId, externalRoomId])
|
||||
}
|
||||
|
||||
/// یک پیام سنجاقشده در هر اتاق (برای همه اعضا)
|
||||
model ConversationPinnedMessage {
|
||||
id String @id @default(cuid())
|
||||
organizationId String
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
externalRoomId String
|
||||
messageId String
|
||||
preview String @default("")
|
||||
pinnedByUserId String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([organizationId, externalRoomId])
|
||||
@@index([organizationId, externalRoomId])
|
||||
}
|
||||
|
||||
/// سنجاق گفتگو در لیست — فقط برای همان کاربر
|
||||
model ConversationRoomUserPin {
|
||||
id String @id @default(cuid())
|
||||
organizationId String
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
userId String
|
||||
externalRoomId String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([organizationId, userId, externalRoomId])
|
||||
@@index([organizationId, userId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user