forgejo/models/auth
Gusted fc9db11c56 feat: avoid updating all columns (#9572)
This patch contains two fixes/enhancements to two functions that were updating all columns of the `access_token` and `repository` table when they were only updating a select few columns. Within Codeberg we saw these two queries quite often when something problematic with the database was going on, likely because of this all columns update pattern. `UpdateAccessToken` is removed and a new function `UpdateLastUsed` was added, for `updateRepoRunsNumbers` we can simply add which columns we want to have updated in that query.

It's likely there are more of such queries, but these were the ones being executed often.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9572
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-10-09 13:22:29 +02:00
..
TestOrphanedOAuth2Applications
access_token.go feat: avoid updating all columns (#9572) 2025-10-09 13:22:29 +02:00
access_token_scope.go Add new CLI flags to set name and scopes when creating a user with access token (#34080) 2025-04-07 17:26:34 +02:00
access_token_scope_test.go
access_token_test.go feat: avoid updating all columns (#9572) 2025-10-09 13:22:29 +02:00
auth_token.go chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
oauth2.go chore(sec): unify usage of crypto/rand.Read (#7453) 2025-04-04 03:31:37 +00:00
oauth2_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
oauth2_test.go chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7648) 2025-04-25 09:14:33 +00:00
session.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
session_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
source.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
source_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
two_factor.go feat: consider WebAuthn & SSH for instance signing (#7693) 2025-04-29 10:34:07 +00:00
two_factor_test.go chore: add SQL fault injector testing (#9314) 2025-09-18 00:39:06 +02:00
twofactor.go feat: consider WebAuthn & SSH for instance signing (#7693) 2025-04-29 10:34:07 +00:00
webauthn.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
webauthn_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00