]> source.dussan.org Git - gitea.git/commitdiff
[doctor] pq: syntax error at or near "." quote user table name (#19765) (#19770)
authorsilentcodeg <105681448+silentcodeg@users.noreply.github.com>
Sat, 21 May 2022 00:00:52 +0000 (02:00 +0200)
committerGitHub <noreply@github.com>
Sat, 21 May 2022 00:00:52 +0000 (02:00 +0200)
Backport #19765

modules/doctor/dbconsistency.go

index 53c988897cd6034820b966e9e3789378bd4a89dd..dea33d97fe212c9136f8003e2fd4ca6b9e47fd92 100644 (file)
@@ -188,10 +188,10 @@ func checkDBConsistency(logger log.Logger, autofix bool) error {
                        "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"),