mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
23 lines
569 B
Go
23 lines
569 B
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/formancehq/stack/libs/go-libs/migrations"
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
// EncryptionKey is set from the migration utility to specify default encryption key to migrate to.
|
|
// This can remain empty. Then the config will be removed.
|
|
//
|
|
//nolint:gochecknoglobals // This is a global variable by design.
|
|
var EncryptionKey string
|
|
|
|
func Migrate(ctx context.Context, db *bun.DB) error {
|
|
migrator := migrations.NewMigrator()
|
|
registerMigrationsV0(migrator)
|
|
registerMigrationsV1(ctx, migrator)
|
|
|
|
return migrator.Up(ctx, db)
|
|
}
|