Skip to content

Commit

Permalink
feat: notification silence description
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Sep 10, 2024
1 parent 6f6bc24 commit 4ceaf5d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
21 changes: 11 additions & 10 deletions models/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions schema/notifications.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ table "notification_silences" {
null = false
type = text
}
column "description" {
null = true
type = text
}
column "from" {
null = false
type = timestamptz
Expand Down

0 comments on commit 4ceaf5d

Please sign in to comment.