Sfoglia il codice sorgente

add jsonb config to notification config schema: (#4243)

d-g-town 2 anni fa
parent
commit
cc48606aba

+ 3 - 0
internal/models/integrations/slack.go

@@ -44,6 +44,9 @@ type SlackIntegration struct {
 
 	// The webhook to call
 	Webhook []byte
+
+	// NotificationConfigID is the ID of the notification config to use
+	NotificationConfigID uint `gorm:"default:0"`
 }
 
 func (s *SlackIntegration) ToSlackIntegraionType() *types.SlackIntegration {

+ 3 - 0
internal/models/notification.go

@@ -17,6 +17,9 @@ type NotificationConfig struct {
 
 	LastNotifiedTime time.Time
 	NotifLimit       string
+
+	// Config is a JSONB column that stores arbitrary notification config
+	Config JSONB `json:"config" sql:"type:jsonb" gorm:"type:jsonb;default:'{}'"`
 }
 
 func (conf *NotificationConfig) ToNotificationConfigType() *types.NotificationConfig {