diff options
| author | 2025-06-13 16:05:00 +0200 | |
|---|---|---|
| committer | 2025-06-13 16:05:00 +0200 | |
| commit | 726584287a721d22a0287e62a37e14c81e01b454 (patch) | |
| tree | c4e054a06b82bf00ca3b4b4d5980b043ea62fe30 /internal/db/bundb/migrations/20250321131230_relax_account_uri_uniqueness.go | |
| parent | [chore] upgrade golangci-lint to v2.1.6 and migrate config (#4265) (diff) | |
| download | gotosocial-726584287a721d22a0287e62a37e14c81e01b454.tar.xz | |
[bugfix] Remove hardcoded "public" db schema assumption (#4269)
This pull request closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4257 by removing the hardcoded "public" schema assumption in the database migrations. Tested on a local postgres with both the default public schema, and with the connection string (gotosocial schema) mentioned in the issue. Both seem to work OK!
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4269
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/db/bundb/migrations/20250321131230_relax_account_uri_uniqueness.go')
| -rw-r--r-- | internal/db/bundb/migrations/20250321131230_relax_account_uri_uniqueness.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/migrations/20250321131230_relax_account_uri_uniqueness.go b/internal/db/bundb/migrations/20250321131230_relax_account_uri_uniqueness.go index 7be070bee..2b38e98d5 100644 --- a/internal/db/bundb/migrations/20250321131230_relax_account_uri_uniqueness.go +++ b/internal/db/bundb/migrations/20250321131230_relax_account_uri_uniqueness.go @@ -379,7 +379,7 @@ func init() { if _, err := tx.ExecContext( ctx, "ALTER TABLE ? DROP CONSTRAINT IF EXISTS ?", - bun.Ident("public.accounts"), + bun.Ident("accounts"), bun.Safe(spec.old), ); err != nil { return err @@ -388,7 +388,7 @@ func init() { if _, err := tx.ExecContext( ctx, "ALTER TABLE ? ADD CONSTRAINT ? UNIQUE(?)", - bun.Ident("public.accounts"), + bun.Ident("accounts"), bun.Safe(spec.new), bun.Safe(strings.Join(spec.columns, ",")), ); err != nil { |
