diff --git a/models/notifications.go b/models/notifications.go index 5c14f6ef..f720d600 100644 --- a/models/notifications.go +++ b/models/notifications.go @@ -55,6 +55,7 @@ const ( NotificationStatusError = "error" NotificationStatusSent = "sent" NotificationStatusSending = "sending" + NotificationStatusPending = "pending" // delayed NotificationStatusSilenced = "silenced" NotificationStatusRepeatInterval = "repeat-interval" ) @@ -68,6 +69,9 @@ type NotificationSendHistory struct { CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp"` Status string `json:"status,omitempty"` + // The duration to delay sending after its creation. + Delay *time.Duration `json:"delay,omitempty"` + // Notifications that were silenced or blocked by repeat intervals // use this counter. Count int `json:"count"` diff --git a/schema/notifications.hcl b/schema/notifications.hcl index 92688b8d..281d9c7d 100644 --- a/schema/notifications.hcl +++ b/schema/notifications.hcl @@ -139,6 +139,11 @@ table "notification_send_history" { null = true type = text } + column "delay" { + null = true + type = bigint + comment = "wait for this duration (nanoseconds)" + } column "count" { null = false default = 1