diff options
author | 6543 <6543@obermui.de> | 2023-09-28 04:03:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-28 03:03:08 +0000 |
commit | 15fa0383fb5dd9ad1702dbc34ba7100c0cdbcc8c (patch) | |
tree | 84629a072dfd3368636df8aa2963f175d6bd90f3 /modules | |
parent | 98f02203f9ed7308686995c2b93e7e35f0c0b412 (diff) | |
download | gitea-15fa0383fb5dd9ad1702dbc34ba7100c0cdbcc8c.tar.gz gitea-15fa0383fb5dd9ad1702dbc34ba7100c0cdbcc8c.zip |
doctor: delete action entries without existing user (#27292)
just extend doctor with a usefully check :)
Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/doctor/dbconsistency.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/doctor/dbconsistency.go b/modules/doctor/dbconsistency.go index a0637b8982..e5fc5785e8 100644 --- a/modules/doctor/dbconsistency.go +++ b/modules/doctor/dbconsistency.go @@ -189,6 +189,9 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er // find action without repository genericOrphanCheck("Action entries without existing repository", "action", "repository", "action.repo_id=repository.id"), + // find action without user + genericOrphanCheck("Action entries without existing user", + "action", "user", "action.act_user_id=`user`.id"), // find OAuth2Grant without existing user genericOrphanCheck("Orphaned OAuth2Grant without existing User", "oauth2_grant", "user", "oauth2_grant.user_id=`user`.id"), |