From a21e0947477c2e21d168ed031f1e3ac8edf6d025 Mon Sep 17 00:00:00 2001 From: Gary Kim Date: Mon, 19 Aug 2019 21:54:01 +0800 Subject: [PATCH] Readd NOT NULL to new preference string Signed-off-by: Gary Kim --- models/migrations/v93.go | 2 +- models/user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/migrations/v93.go b/models/migrations/v93.go index 0aab9453ccd69..a286c8e6f27f2 100644 --- a/models/migrations/v93.go +++ b/models/migrations/v93.go @@ -9,7 +9,7 @@ import "github.com/go-xorm/xorm" func addEmailNotificationEnabledToUser(x *xorm.Engine) error { // Issue see models/user.go type User struct { - EmailNotificationsPreference string `xorm:"DEFAULT 'enabled'"` + EmailNotificationsPreference string `xorm:"NOT NULL DEFAULT 'enabled'"` } return x.Sync2(new(User)) diff --git a/models/user.go b/models/user.go index cb8a8f156baa4..f69fd2f540407 100644 --- a/models/user.go +++ b/models/user.go @@ -96,7 +96,7 @@ type User struct { // Email is the primary email address (to be used for communication) Email string `xorm:"NOT NULL"` KeepEmailPrivate bool - EmailNotificationsPreference string `xorm:"DEFAULT 'enabled'"` + EmailNotificationsPreference string `xorm:"NOT NULL DEFAULT 'enabled'"` Passwd string `xorm:"NOT NULL"` PasswdHashAlgo string `xorm:"NOT NULL DEFAULT 'pbkdf2'"`