forgejo/models
Aravinth Manivannan 076cead40d
Fix CheckRepoStats and reuse it during migration (#18264)
The CheckRepoStats function missed the following counters:

- label num_closed_issues & num_closed_pulls
- milestone num_closed_issues & num_closed_pulls

The update SQL statements for updating the repository
num_closed_issues & num_closed_pulls fields were repeated in three
functions (repo.CheckRepoStats, migrate.insertIssues and
models.Issue.updateClosedNum) and were moved to a single helper.

The UpdateRepoStats is implemented and called in the Finish migration method so that it happens immediately instead of wating for the
CheckRepoStats to run.

Signed-off-by: Loïc Dachary loic@dachary.org

---
[source](https://lab.forgefriends.org/forgefriends/forgefriends/-/merge_requests/34)
2022-01-17 19:31:58 +01:00
..
admin
appstate
asymkey
auth
avatars
db
fixtures
issues
migrations
perm
repo
unit
unittest
user
webhook
access.go
access_test.go
action.go
action_list.go
action_test.go
branches.go
branches_test.go
commit.go
commit_status.go
commit_status_test.go
consistency.go
consistency_test.go
engine_test.go
error.go
fixture_generation.go
fixture_test.go
helper.go
helper_directory.go
helper_environment.go
issue.go
issue_assignees.go
issue_assignees_test.go
issue_comment.go
issue_comment_list.go
issue_comment_test.go
issue_dependency.go
issue_dependency_test.go
issue_label.go
issue_label_test.go
issue_list.go
issue_list_test.go
issue_lock.go
issue_milestone.go
issue_milestone_test.go
issue_reaction.go
issue_reaction_test.go
issue_stopwatch.go
issue_stopwatch_test.go
issue_test.go
issue_tracked_time.go
issue_tracked_time_test.go
issue_user.go
issue_user_test.go
issue_watch.go
issue_watch_test.go
issue_xref.go
issue_xref_test.go
lfs.go
lfs_lock.go
main_test.go
migrate.go
migrate_test.go
notification.go
notification_test.go
org.go
org_team.go
org_team_test.go
org_test.go
project.go
project_board.go
project_issue.go
project_test.go
protected_tag.go
protected_tag_test.go
pull.go
pull_list.go
pull_test.go
release.go
repo.go
repo_activity.go
repo_collaboration.go
repo_collaboration_test.go
repo_generate.go
repo_generate_test.go
repo_list.go
repo_list_test.go
repo_permission.go
repo_permission_test.go
repo_test.go
repo_transfer.go
repo_transfer_test.go
review.go
review_test.go
statistic.go
task.go
token.go
token_test.go
upload.go
user.go
user_heatmap.go
user_heatmap_test.go
user_test.go
userlist.go
userlist_test.go