From 566234c30ce46c32db0b6bcd2fc8825d2910a7f5 Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 30 Nov 2025 19:36:07 +0800 Subject: [PATCH] fix: enforce not null constraint and default value for UnreadNotificationsCount --- server/model/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/user.go b/server/model/user.go index 5e256dc..0d8eb14 100644 --- a/server/model/user.go +++ b/server/model/user.go @@ -19,7 +19,7 @@ type User struct { CommentsCount int Resources []Resource `gorm:"foreignKey:UserID"` Bio string - UnreadNotificationsCount uint + UnreadNotificationsCount uint `gorm:"not null;default:0"` } type UserView struct {