From 4696e1a7b389599fa981f334b343daa911b11f5d Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Wed, 1 Sep 2021 18:29:25 +0200 Subject: moving stuff around --- internal/gtsmodel/notification.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/gtsmodel/notification.go') diff --git a/internal/gtsmodel/notification.go b/internal/gtsmodel/notification.go index bb69bc8d4..1b1f39a77 100644 --- a/internal/gtsmodel/notification.go +++ b/internal/gtsmodel/notification.go @@ -22,8 +22,9 @@ import "time" // Notification models an alert/notification sent to an account about something like a reblog, like, new follow request, etc. type Notification struct { - ID string `validate:"ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database - CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"` // when was item created + ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database + CreatedAt time.Time `validate:"-" bun:"type:timestamp,nullzero,notnull,default:current_timestamp"` // when was item created + UpdatedAt time.Time `validate:"-" bun:"type:timestamp,nullzero,notnull,default:current_timestamp"` // when was item last updated // when was item created NotificationType NotificationType `validate:"oneof=follow follow_request mention reblog favourite poll status" bun:",nullzero,notnull"` // Type of this notification TargetAccountID string `validate:"ulid" bun:"type:CHAR(26),nullzero,notnull"` // Which account does this notification target (ie., who will receive the notification?) TargetAccount *Account `validate:"-" bun:"rel:belongs-to"` // Which account performed the action that created this notification? -- cgit v1.2.3