瀏覽代碼

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.
Angus Gibson 9 年之前
父節點
當前提交
e914969e4c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      models/user.go

+ 1 - 1
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