feat: init migrations for transactional tables (#9946)

# Which Problems Are Solved

To start with transactional tables we need to setup the new `zitadel`
schema in a way that does not rely on the event store later.

# How the Problems Are Solved

Setup step added which calls the function which executes the migrations.

# Additional Changes

none

# Additional Context

- closes #9933
This commit is contained in:
Silvan
2025-05-26 08:20:14 +02:00
committed by GitHub
parent 3ddecca600
commit 362420f62b
16 changed files with 197 additions and 36 deletions

View File

@@ -19,6 +19,7 @@ var (
type Config struct {
*pgxpool.Config
*pgxpool.Pool
// Host string
// Port int32
@@ -37,7 +38,7 @@ type Config struct {
// Connect implements [database.Connector].
func (c *Config) Connect(ctx context.Context) (database.Pool, error) {
pool, err := pgxpool.NewWithConfig(ctx, c.Config)
pool, err := c.getPool(ctx)
if err != nil {
return nil, err
}
@@ -47,6 +48,13 @@ func (c *Config) Connect(ctx context.Context) (database.Pool, error) {
return &pgxPool{pool}, nil
}
func (c *Config) getPool(ctx context.Context) (*pgxpool.Pool, error) {
if c.Pool != nil {
return c.Pool, nil
}
return pgxpool.NewWithConfig(ctx, c.Config)
}
func NameMatcher(name string) bool {
return slices.Contains([]string{"postgres", "pg"}, strings.ToLower(name))
}