From a666829a37be6f9fd98f9e7dd1767c420f7f3b32 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 24 Nov 2021 17:49:20 +0800 Subject: Move user related model into models/user (#17781) * Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge --- models/consistency.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'models/consistency.go') diff --git a/models/consistency.go b/models/consistency.go index ba669628b9..d16e7f5e99 100644 --- a/models/consistency.go +++ b/models/consistency.go @@ -7,6 +7,7 @@ package models import ( admin_model "code.gitea.io/gitea/models/admin" "code.gitea.io/gitea/models/db" + user_model "code.gitea.io/gitea/models/user" "xorm.io/builder" ) @@ -169,12 +170,12 @@ func FixNullArchivedRepository() (int64, error) { // CountWrongUserType count OrgUser who have wrong type func CountWrongUserType() (int64, error) { - return db.GetEngine(db.DefaultContext).Where(builder.Eq{"type": 0}.And(builder.Neq{"num_teams": 0})).Count(new(User)) + return db.GetEngine(db.DefaultContext).Where(builder.Eq{"type": 0}.And(builder.Neq{"num_teams": 0})).Count(new(user_model.User)) } // FixWrongUserType fix OrgUser who have wrong type func FixWrongUserType() (int64, error) { - return db.GetEngine(db.DefaultContext).Where(builder.Eq{"type": 0}.And(builder.Neq{"num_teams": 0})).Cols("type").NoAutoTime().Update(&User{Type: 1}) + return db.GetEngine(db.DefaultContext).Where(builder.Eq{"type": 0}.And(builder.Neq{"num_teams": 0})).Cols("type").NoAutoTime().Update(&user_model.User{Type: 1}) } // CountCommentTypeLabelWithEmptyLabel count label comments with empty label -- cgit v1.2.3