Skip to content

Commit

Permalink
feat: allow silence to never expire
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Dec 23, 2024
1 parent bcbd46b commit 010058e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions models/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,20 @@ type NotificationSilence struct {
NotificationSilenceResource `json:",inline" yaml:",inline"`

ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Namespace string `json:"namespace,omitempty"`
Namespace string `json:"namespace,omitempty" gorm:"default:NULL"`
Name string `json:"name,omitempty"`
Filter types.CelExpression `json:"filter,omitempty"`
From time.Time `json:"from"`
Until time.Time `json:"until"`
Filter types.CelExpression `json:"filter,omitempty" gorm:"default:NULL"`
From *time.Time `json:"from,omitempty"`
Until *time.Time `json:"until,omitempty"`
Source string `json:"source"`
Recursive bool `json:"recursive"`
Description string `json:"description,omitempty"`
Description *string `json:"description,omitempty" gorm:"default:NULL"`
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"`

Selectors types.JSON `json:"selectors,omitempty"`
Selectors types.JSON `json:"selectors,omitempty" gorm:"default:NULL"`

// Error contains cel expression error in the filter
Error *string `json:"error,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions schema/notifications.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ table "notification_silences" {
default = sql("generate_ulid()")
}
column "namespace" {
null = false
null = true
type = text
}
column "name" {
Expand All @@ -256,11 +256,11 @@ table "notification_silences" {
type = text
}
column "from" {
null = false
null = true
type = timestamptz
}
column "until" {
null = false
null = true
type = timestamptz
}
column "recursive" {
Expand Down

0 comments on commit 010058e

Please sign in to comment.