From 4ceaf5dcca9f183e6db28ecb2b81da1778b6092c Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 10 Sep 2024 13:25:54 +0545 Subject: [PATCH] feat: notification silence description --- models/notifications.go | 21 +++++++++++---------- schema/notifications.hcl | 4 ++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/models/notifications.go b/models/notifications.go index 180b672c..4ab775ca 100644 --- a/models/notifications.go +++ b/models/notifications.go @@ -126,16 +126,17 @@ func (t NotificationSilenceResource) Key() string { type NotificationSilence struct { NotificationSilenceResource `json:",inline" yaml:",inline"` - ID uuid.UUID `json:"id"` - Namespace string `json:"namespace"` - From time.Time `json:"from"` - Until time.Time `json:"until"` - Source string `json:"source"` - Recursive bool `json:"recursive"` - CreatedBy *uuid.UUID `json:"created_by,omitempty"` - CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"` - UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"<-:false"` - DeletedAt *time.Time `json:"deleted_at,omitempty"` + ID uuid.UUID `json:"id"` + Namespace string `json:"namespace"` + From time.Time `json:"from"` + Until time.Time `json:"until"` + Source string `json:"source"` + Recursive bool `json:"recursive"` + Description string `json:"description,omitempty"` + CreatedBy *uuid.UUID `json:"created_by,omitempty"` + CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"` + UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"<-:false"` + DeletedAt *time.Time `json:"deleted_at,omitempty"` } func (n NotificationSilence) AsMap(removeFields ...string) map[string]any { diff --git a/schema/notifications.hcl b/schema/notifications.hcl index c98e3d8a..96ed279a 100644 --- a/schema/notifications.hcl +++ b/schema/notifications.hcl @@ -177,6 +177,10 @@ table "notification_silences" { null = false type = text } + column "description" { + null = true + type = text + } column "from" { null = false type = timestamptz