Skip to content

Commit 2cc9f82

Browse files
committed
extend doctor check-db-consistency
1 parent 4c2edcc commit 2cc9f82

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/doctor/dbconsistency.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er
186186
// find action without repository
187187
genericOrphanCheck("Action entries without existing repository",
188188
"action", "repository", "action.repo_id=repository.id"),
189+
// find OAuth2Grant without existing user
190+
genericOrphanCheck("Orphaned OAuth2Grant without existing User",
191+
"oauth2_grant", "user", "oauth2_grant.user_id=user.id"),
192+
// find OAuth2Application without existing user
193+
genericOrphanCheck("Orphaned OAuth2Application without existing User",
194+
"oauth2_application", "user", "oauth2_application.uid=user.id"),
195+
// find OAuth2AuthorizationCode without existing OAuth2Grant
196+
genericOrphanCheck("Orphaned OAuth2AuthorizationCode without existing OAuth2Grant",
197+
"oauth2_authorization_code", "oauth2_grant", "oauth2_authorization_code.grant_id=oauth2_grant.id"),
189198
)
190199

191200
for _, c := range consistencyChecks {

0 commit comments

Comments
 (0)