You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CountWrongLabels counts wrong data in issue_label and label
784
-
funcCountWrongLabels() (int64, int64, error) {
785
-
wrongLabels, err:=x.Where("repo_id > 0 and repo_id not in (select id from repository)").Count(new(Label))
786
-
iferr!=nil {
787
-
return0, 0, err
788
-
}
789
-
790
-
wrongIssueLabels, err:=x.Where("label_id IN (select id from label where repo_id > 0 and repo_id not in (select id from repository))").Count(new(IssueLabel))
791
-
iferr!=nil {
792
-
return0, 0, err
793
-
}
794
-
795
-
returnwrongLabels, wrongIssueLabels, nil
796
-
}
797
-
798
-
// FixWrongLabels fix wrong data in label
799
-
funcFixWrongLabels() (int64, error) {
800
-
res, err:=x.Exec("DELETE FROM label WHERE repo_id > 0 and repo_id not in (select id from repository)")
801
-
iferr!=nil {
802
-
return0, err
803
-
}
804
-
returnres.RowsAffected()
805
-
}
806
-
807
-
// FixWrongIssueLables fix wrong label data
808
-
funcFixWrongIssueLables() (int64, error) {
809
-
res, err:=x.Exec("DELETE FROM issue_label WHERE label_id in (select id FROM label WHERE repo_id > 0 and repo_id not in (select id from repository))")
0 commit comments