Add doctor orphan check for orphaned pull requests without an existing base repo (#19731)

This commit is contained in:
silentcodeg 2022-05-18 02:34:32 +02:00 committed by GitHub
parent 9ea9206406
commit e82db15cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,6 +105,9 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er
// find pulls without existing issues // find pulls without existing issues
genericOrphanCheck("Orphaned PullRequests without existing issue", genericOrphanCheck("Orphaned PullRequests without existing issue",
"pull_request", "issue", "pull_request.issue_id=issue.id"), "pull_request", "issue", "pull_request.issue_id=issue.id"),
// find pull requests without base repository
genericOrphanCheck("Pull request entries without existing base repository",
"pull_request", "repository", "pull_request.base_repo_id=repository.id"),
// find tracked times without existing issues/pulls // find tracked times without existing issues/pulls
genericOrphanCheck("Orphaned TrackedTimes without existing issue", genericOrphanCheck("Orphaned TrackedTimes without existing issue",
"tracked_time", "issue", "tracked_time.issue_id=issue.id"), "tracked_time", "issue", "tracked_time.issue_id=issue.id"),