mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 05:00:01 +02:00
Add Doctor FixWrongUserType (#14522)
* Add Doctor FixWrongUserType * use NoAutoTime
This commit is contained in:
parent
05365816ab
commit
0e0424c8ec
2 changed files with 51 additions and 1 deletions
|
@ -291,7 +291,17 @@ func CountNullArchivedRepository() (int64, error) {
|
|||
|
||||
// FixNullArchivedRepository sets is_archived to false where it is null
|
||||
func FixNullArchivedRepository() (int64, error) {
|
||||
return x.Where(builder.IsNull{"is_archived"}).Cols("is_archived").Update(&Repository{
|
||||
return x.Where(builder.IsNull{"is_archived"}).Cols("is_archived").NoAutoTime().Update(&Repository{
|
||||
IsArchived: false,
|
||||
})
|
||||
}
|
||||
|
||||
// CountWrongUserType count OrgUser who have wrong type
|
||||
func CountWrongUserType() (int64, error) {
|
||||
return x.Where(builder.Eq{"type": 0}.And(builder.Neq{"num_teams": 0})).Count(new(User))
|
||||
}
|
||||
|
||||
// FixWrongUserType fix OrgUser who have wrong type
|
||||
func FixWrongUserType() (int64, error) {
|
||||
return x.Where(builder.Eq{"type": 0}.And(builder.Neq{"num_teams": 0})).Cols("type").NoAutoTime().Update(&User{Type: 1})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue