소스 검색

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