]> source.dussan.org Git - gitea.git/commitdiff
[doctor] pq: syntax error at or near "." quote user table name (#19765)
authorsilentcodeg <105681448+silentcodeg@users.noreply.github.com>
Fri, 20 May 2022 07:36:34 +0000 (09:36 +0200)
committerGitHub <noreply@github.com>
Fri, 20 May 2022 07:36:34 +0000 (15:36 +0800)
modules/doctor/dbconsistency.go

index 03426d8247e6b58d44a4eed0bd5a3bb7cec83a04..18cb2cdac63910f09fd1b372252c238a2a4de77a 100644 (file)
@@ -191,10 +191,10 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er
                        "action", "repository", "action.repo_id=repository.id"),
                // find OAuth2Grant without existing user
                genericOrphanCheck("Orphaned OAuth2Grant without existing User",
-                       "oauth2_grant", "user", "oauth2_grant.user_id=user.id"),
+                       "oauth2_grant", "user", "oauth2_grant.user_id=`user`.id"),
                // find OAuth2Application without existing user
                genericOrphanCheck("Orphaned OAuth2Application without existing User",
-                       "oauth2_application", "user", "oauth2_application.uid=user.id"),
+                       "oauth2_application", "user", "oauth2_application.uid=`user`.id"),
                // find OAuth2AuthorizationCode without existing OAuth2Grant
                genericOrphanCheck("Orphaned OAuth2AuthorizationCode without existing OAuth2Grant",
                        "oauth2_authorization_code", "oauth2_grant", "oauth2_authorization_code.grant_id=oauth2_grant.id"),