From cd98531821d593431db866c0adb9a08eaad16883 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Mon, 23 Dec 2024 17:57:35 +0545 Subject: [PATCH] feat: allow silence to never expire --- models/notifications.go | 6 +++--- schema/notifications.hcl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/models/notifications.go b/models/notifications.go index 39fc792d..84489a7c 100644 --- a/models/notifications.go +++ b/models/notifications.go @@ -185,11 +185,11 @@ type NotificationSilence struct { Namespace string `json:"namespace,omitempty"` Name string `json:"name,omitempty"` Filter types.CelExpression `json:"filter,omitempty"` - From time.Time `json:"from"` - Until time.Time `json:"until"` + 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"` 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"` diff --git a/schema/notifications.hcl b/schema/notifications.hcl index 49eaf68a..0809646f 100644 --- a/schema/notifications.hcl +++ b/schema/notifications.hcl @@ -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" {