Appearance
dbo.makesafeSMSMessage
Info Generated by
scripts/Generate-DataDictionary.ps1- do not edit by hand. Edit descriptions inschemas/tables/dbo.makesafeSMSMessage.jsonand regenerate.
Columns
| # | Column | Type | Nullable | Flags | Description |
|---|---|---|---|---|---|
| 1 | ID | int | no | identity | Primary key, identity. |
| 2 | Sent | datetime | yes | Timestamp the SMS was sent/received via ClickSend. | |
| 3 | FromMobile | nvarchar(50) | yes | Mobile number the SMS was sent from. | |
| 4 | ToMobile | nvarchar(50) | no | Mobile number the SMS was sent to. | |
| 5 | FromUserID | int | yes | FK to makesafeUser.ID identifying the staff sender, if the message was sent by a user. | |
| 6 | ToUserID | int | yes | FK to makesafeUser.ID identifying the staff recipient, if the message was sent to a user. | |
| 7 | OriginalMessageID | uniqueidentifier | yes | ID of the message this one is a reply to, linking a reply thread. | |
| 8 | MessageID | uniqueidentifier | yes | Unique identifier for this SMS, e.g. as assigned by the ClickSend gateway. | |
| 9 | Body | nvarchar(MAX) | yes | Text content of the SMS. | |
| 10 | CustomString | nvarchar(255) | yes | Custom reference string passed to/from ClickSend to correlate the message with internal records. | |
| 11 | ResponseCode | int | yes | Response/status code returned by the ClickSend API for this message. | |
| 12 | PhoneCallID | int | yes | FK to makesafePhoneCall.ID this SMS relates to, if any. | |
| 13 | Outbound | bit | no | True if the SMS was sent by Ethos to the recipient, false if received inbound (e.g. an SMS reply). | |
| 14 | Status | tinyint | no | Delivery/processing status code of the SMS. | |
| 15 | Type | tinyint | no | Category code of the SMS (e.g. notification, reply, escalation alert). | |
| 16 | createdAt | datetime | no | Timestamp the record was created. | |
| 17 | FromContactID | uniqueidentifier | yes | FK to primeContacts identifying the Prime Ecosystem contact who sent the message, if applicable. | |
| 18 | ToContactID | uniqueidentifier | yes | FK to primeContacts identifying the Prime Ecosystem contact who received the message, if applicable. |
Indexes
| Name | Type | Unique | PK | Key columns | Included | Filter |
|---|---|---|---|---|---|---|
| IX_makesafeSMSMessage_Sent_Outbound | NONCLUSTERED | Outbound, Sent |
Relationships (inferred)
| From | To | Confidence |
|---|---|---|
| dbo.makesafeSMSMessage.FromUserID | dbo.makesafeUser.ID | high |
| dbo.makesafeSMSMessage.ToUserID | dbo.makesafeUser.ID | high |
Referenced by
Procedures: dbo.spClickSendInsertSMSReply, dbo.spMakesafeGetAllMessages, dbo.spMakesafeGetAllSMSMessages, dbo.spMakesafeGetMessagesPaged, dbo.spMakesafeGetQueuedSMSMessages, dbo.spMakesafeGetQueuedSMSMessagesCount, dbo.spMakesafeGetSMSMessageByID, dbo.spMakesafeGetSMSMessagesbyID, dbo.spMakesafeInsertSMSMessage, dbo.spMakesafeInsertSMSReply, dbo.spMakesafeQueueEscalationSMSMessagesNoSchedules, dbo.spMakesafeQueueEscalationSMSMessagesUnassigned, dbo.spMakesafeQueueOnCallSMSAssignedNotClosed, dbo.spMakesafeQueueOnCallSMSMessagesUnassigned, dbo.spMakesafeQueueSMSMessage, dbo.spMakesafeQueueSMSMessageSMSMessages, dbo.spMakesafeUpdateQueuedSMSMessage, dbo.spMakesafeUpdateSMSStatus, dbo.spN8nQueueEscalationFailedExecutions, dbo.spN8nQueueEscalationPrimeRateLimit

