summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorsilentcodeg <105681448+silentcodeg@users.noreply.github.com>2022-05-18 02:34:32 +0200
committerGitHub <noreply@github.com>2022-05-18 02:34:32 +0200
commite82db15cfa0d1cd85ee493128960a481eb44271c (patch)
tree8044ca511dc33e5d9d4748caa8adb47e2de34bc9 /modules
parent9ea9206406583f3402be2630c57133f810c460d2 (diff)
downloadgitea-e82db15cfa0d1cd85ee493128960a481eb44271c.tar.gz
gitea-e82db15cfa0d1cd85ee493128960a481eb44271c.zip
Add doctor orphan check for orphaned pull requests without an existing base repo (#19731)
Diffstat (limited to 'modules')
-rw-r--r--modules/doctor/dbconsistency.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/doctor/dbconsistency.go b/modules/doctor/dbconsistency.go
index 9ab8feb679..03426d8247 100644
--- a/modules/doctor/dbconsistency.go
+++ b/modules/doctor/dbconsistency.go
@@ -105,6 +105,9 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er
// find pulls without existing issues
genericOrphanCheck("Orphaned PullRequests without existing issue",
"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
genericOrphanCheck("Orphaned TrackedTimes without existing issue",
"tracked_time", "issue", "tracked_time.issue_id=issue.id"),