From 2953080339b64d4762080fa5a65df597d2237430 Mon Sep 17 00:00:00 2001 From: 71rd Date: Mon, 2 Dec 2024 15:46:29 +0000 Subject: [PATCH] fix: dbconsistency check adding missing quotes On postgres the new check for orphaned authorization tokens fails with: - [E] Error: pq: syntax error at or near "." whilst counting Authorization token without existing User Adding marks to the user table reference allows the check to succeed --- services/doctor/dbconsistency.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/doctor/dbconsistency.go b/services/doctor/dbconsistency.go index 7207c3ff50..80f538d670 100644 --- a/services/doctor/dbconsistency.go +++ b/services/doctor/dbconsistency.go @@ -245,7 +245,7 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er "repo_archive_download_count", "release", "repo_archive_download_count.release_id=release.id"), // find authorization tokens without existing user genericOrphanCheck("Authorization token without existing User", - "forgejo_auth_token", "user", "forgejo_auth_token.uid=user.id"), + "forgejo_auth_token", "user", "forgejo_auth_token.uid=`user`.id"), ) for _, c := range consistencyChecks {