diff options
author | zeripath <art27@cantab.net> | 2022-06-18 04:31:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-18 11:31:00 +0800 |
commit | dd1ed35f756ea1087f0c55618d6cf745192b612d (patch) | |
tree | c01d82b10602463c95a450f74a59a9de304daec4 /modules | |
parent | fd0d481de8ae8a94b56038da4258fb0cdc0a18a3 (diff) | |
download | gitea-dd1ed35f756ea1087f0c55618d6cf745192b612d.tar.gz gitea-dd1ed35f756ea1087f0c55618d6cf745192b612d.zip |
Add dbconsistency checks for Stopwatches (#20010)
It appears possible that stopwatches can become orphaned or have been orphaned in
the past.
This PR adds Orphan checks for Stopwatches.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/doctor/dbconsistency.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/doctor/dbconsistency.go b/modules/doctor/dbconsistency.go index b23807cca2..349a2121cf 100644 --- a/modules/doctor/dbconsistency.go +++ b/modules/doctor/dbconsistency.go @@ -199,6 +199,12 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er // find OAuth2AuthorizationCode without existing OAuth2Grant genericOrphanCheck("Orphaned OAuth2AuthorizationCode without existing OAuth2Grant", "oauth2_authorization_code", "oauth2_grant", "oauth2_authorization_code.grant_id=oauth2_grant.id"), + // find stopwatches without existing user + genericOrphanCheck("Orphaned Stopwatches without existing User", + "stopwatch", "user", "stopwatch.user_id=user.id"), + // find stopwatches without existing issue + genericOrphanCheck("Orphaned Stopwatches without existing Issue", + "stopwatch", "issue", "stopwatch.issue_id=issue.id"), ) for _, c := range consistencyChecks { |