summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Mara Sophie Grosch <littlefox@lf-net.org>2022-06-16 11:22:51 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-16 11:22:51 +0200
commit0e12ee0aa10a1f5ffed4d62e3d9f858c8faa8116 (patch)
tree29933452cbf0c781043484a7b6b98dd973596570
parent[chore] Duplicated media cleanup (#649) (diff)
downloadgotosocial-0e12ee0aa10a1f5ffed4d62e3d9f858c8faa8116.tar.xz
postgres locale: fix accounts.note_raw migration (#651)
Database migration 20220506110822_add_account_raw_note.go has some error handling code to detect some error messages as "ok", but only done for english error messages. This commit adds a check for the specific error code, which should be locale agnostic.
-rw-r--r--internal/db/bundb/migrations/20220506110822_add_account_raw_note.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/db/bundb/migrations/20220506110822_add_account_raw_note.go b/internal/db/bundb/migrations/20220506110822_add_account_raw_note.go
index 816d21b73..f56ad4ff0 100644
--- a/internal/db/bundb/migrations/20220506110822_add_account_raw_note.go
+++ b/internal/db/bundb/migrations/20220506110822_add_account_raw_note.go
@@ -28,7 +28,7 @@ import (
func init() {
up := func(ctx context.Context, db *bun.DB) error {
_, err := db.ExecContext(ctx, "ALTER TABLE ? ADD COLUMN ? TEXT", bun.Ident("accounts"), bun.Ident("note_raw"))
- if err != nil && !(strings.Contains(err.Error(), "already exists") || strings.Contains(err.Error(), "duplicate column name")) {
+ if err != nil && !(strings.Contains(err.Error(), "already exists") || strings.Contains(err.Error(), "duplicate column name") || strings.Contains(err.Error(), "SQLSTATE 42701")) {
return err
}
return nil