Skip to content

Commit 15fa038

Browse files
6543techknowlogick
andauthored
doctor: delete action entries without existing user (#27292)
just extend doctor with a usefully check :) Co-authored-by: techknowlogick <techknowlogick@gitea.com>
1 parent 98f0220 commit 15fa038

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/doctor/dbconsistency.go

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er
189189
// find action without repository
190190
genericOrphanCheck("Action entries without existing repository",
191191
"action", "repository", "action.repo_id=repository.id"),
192+
// find action without user
193+
genericOrphanCheck("Action entries without existing user",
194+
"action", "user", "action.act_user_id=`user`.id"),
192195
// find OAuth2Grant without existing user
193196
genericOrphanCheck("Orphaned OAuth2Grant without existing User",
194197
"oauth2_grant", "user", "oauth2_grant.user_id=`user`.id"),

0 commit comments

Comments
 (0)