fix: harden real backend workflows and channel connections
This commit is contained in:
@@ -352,6 +352,7 @@ model SmsApplication {
|
||||
sendTasks SmsSendTask[]
|
||||
batchTasks SmsBatchTask[]
|
||||
messageRecords SmsMessageRecord[]
|
||||
connectionStates CmppConnectionState[]
|
||||
|
||||
@@index([tenantId, status])
|
||||
}
|
||||
@@ -502,6 +503,7 @@ model SmsChannel {
|
||||
model CmppConnectionState {
|
||||
id String @id @default(cuid())
|
||||
tenantId String?
|
||||
applicationId String?
|
||||
channelId String
|
||||
connectionId String
|
||||
status String @default("disconnected")
|
||||
@@ -515,11 +517,13 @@ model CmppConnectionState {
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
tenant Tenant? @relation(fields: [tenantId], references: [id])
|
||||
channel SmsChannel @relation(fields: [channelId], references: [id])
|
||||
tenant Tenant? @relation(fields: [tenantId], references: [id])
|
||||
application SmsApplication? @relation(fields: [applicationId], references: [id])
|
||||
channel SmsChannel @relation(fields: [channelId], references: [id])
|
||||
|
||||
@@unique([channelId, connectionId])
|
||||
@@unique([applicationId, channelId, connectionId])
|
||||
@@index([tenantId, status])
|
||||
@@index([applicationId, status])
|
||||
@@index([channelId, status])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user