aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAngus Gibson <angus.gibson@anu.edu.au>2015-12-22 11:09:28 +1100
committerAngus Gibson <angus.gibson@anu.edu.au>2015-12-22 11:09:28 +1100
commite914969e4c5d3269cc54d174983ba9e504f1d5d9 (patch)
treed56e7321227d72e1c7a32800a89e0d9504640d11 /models
parenta49af93fafe824cdd375318d15de420b3ed61e79 (diff)
downloadgitea-e914969e4c5d3269cc54d174983ba9e504f1d5d9.tar.gz
gitea-e914969e4c5d3269cc54d174983ba9e504f1d5d9.zip
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.
Diffstat (limited to 'models')
-rw-r--r--models/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index 1a8500ac76..f648a8abcf 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