Skip to main content

remindersms

Table: remindersms

The remindersms table stores SMS reminders sent to recipients.
It tracks the schedule, content, status, and associations with events, users, and reminders.


Columns

Column NameData TypeConstraintsDescription
rsmsRecordNumint(11)NOT NULL, PRIMARY KEY, AUTO_INCREMENTUnique identifier for each reminder SMS
createdDatedatetimeDEFAULT NULLTimestamp when the SMS record was created
dayNumbersmallint(6)NOT NULLNumber of days from the event for this SMS
descriptionvarchar(255)DEFAULT NULLOptional description of the SMS
dueDatedatetimeNOT NULLScheduled date and time to send the SMS
hoursDifferenceint(11)DEFAULT NULLOptional difference in hours relative to dueDate
lastEditedDatedatetimeDEFAULT NULLTimestamp of last edit
originatorvarchar(20)DEFAULT NULLSender identifier
recipientvarchar(20)DEFAULT NULLRecipient phone number
referenceNumbervarchar(255)UNIQUEUnique reference number for the SMS
reminderIdsmallint(6)DEFAULT NULLLinked reminder ID
reminderStatusvarchar(20)DEFAULT NULLStatus of the SMS (e.g., SCHEDULED, SENT)
sentDatedatetimeDEFAULT NULLTimestamp when SMS was sent
smsCancelReasonvarchar(255)DEFAULT NULLReason for cancellation, if any
smsCancelReasonOthervarchar(255)DEFAULT NULLAdditional explanation for cancellation
textvarchar(2000)DEFAULT NULLSMS message content
vaccinationRecordNumint(11)DEFAULT NULLRelated vaccination record, if applicable
createdByUserIdint(11)DEFAULT NULLUser who created the SMS record
lastEditedByUserIdint(11)DEFAULT NULLUser who last edited the SMS record
womenAnalysisRecordNumint(11)DEFAULT NULLLinked women analysis record

Indexes

  • PRIMARY: Primary key on rsmsRecordNum
  • UNIQUE: referenceNumber
  • remindersms_reminderId_reminder_reminderId_FK: Index on reminderId
  • remindersms_lastEditedByUserId_user_mappedId_FK: Index on lastEditedByUserId
  • remindersms_createdByUserId_user_mappedId_FK: Index on createdByUserId
  • remindersms_vaccRecNumIndex: Index on vaccinationRecordNum
  • womenanalysis: Index on womenAnalysisRecordNum
  • idx_remindersms_dueDate_reminderStatus: Composite index on (dueDate, reminderStatus) for scheduled SMS queries

Foreign Key Relations

  • createdByUserIduser.mappedId
  • lastEditedByUserIduser.mappedId
  • reminderIdreminder.reminderId

Usage Notes

  • Stores all SMS reminders generated for events like vaccination, appointments, or system notifications.
  • reminderStatus tracks SMS lifecycle (SCHEDULED, SENT, CANCELLED).
  • Supports linking with vaccination records and women analysis records for reporting.
  • Composite index (dueDate, reminderStatus) improves query performance for scheduled SMS counts.