From e914969e4c5d3269cc54d174983ba9e504f1d5d9 Mon Sep 17 00:00:00 2001 From: Angus Gibson Date: Tue, 22 Dec 2015 11:09:28 +1100 Subject: [PATCH] Add default for NumFollowing field (fixes #2261) We set the default value for the non-NULL field NumFollowing of the User model to 0, which stops an error when the ORM tries to sync. --- models/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index 1a8500ac7..f648a8abc 100644 --- a/models/user.go +++ b/models/user.go @@ -91,7 +91,7 @@ type User struct { // Counters NumFollowers int - NumFollowing int `xorm:"NOT NULL"` + NumFollowing int `xorm:"NOT NULL DEFAULT 0"` NumStars int NumRepos int