Files
payments/internal/storage/migrations/15-add-webhook_configs-metadata-column.go
CrimsonandGitHub db0561d07e fix(column): Various fixes for Column Payments (#431)
* Set webhook ID as payment adjustment ID when adjustment created via webhook

* Fetch Column payments oldest to newest

* Ensure that webhook secrets are fetched when containers restart

* Regenerate plugin code for tests

* Add paging to fetch webhook request

* Add WorkerPool unit test to increase test coverage

* Guard against unhandled webhooks in Column plugin initiation

* Rename Timeline.LatestID to Timeline.LastSeenID for clarity

* Add metadata column to webhooks_configs table

* Persist webhook_configs.metadata

* Persist Column webhook secrets as metadata in webhooks_configs

* Remove PSPWebhookConfig from InstallResponse

* Stop passing context to initWebhookConfig()

* Don't pass context to RegisterPlugin func

* Don't pass context to plugins.RegisterPlugin
2025-05-12 09:24:59 +00:00

24 lines
455 B
Go

package migrations
import (
"context"
"github.com/uptrace/bun"
)
func AddWebhooksConfigsMetadata(ctx context.Context, db bun.IDB) error {
_, err := db.ExecContext(ctx, `
ALTER TABLE webhooks_configs ADD COLUMN IF NOT EXISTS metadata jsonb default '{}'::jsonb;
`)
if err != nil {
return err
}
_, err = db.ExecContext(ctx, `
ALTER TABLE webhooks_configs ALTER COLUMN metadata SET NOT NULL;
`)
if err != nil {
return err
}
return nil
}