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

@@ -6,11 +6,15 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/zitadel/zitadel/backend/v3/storage/database"
"github.com/zitadel/zitadel/backend/v3/storage/database/dialect/postgres/migration"
)
type pgxConn struct{ *pgxpool.Conn }
var _ database.Client = (*pgxConn)(nil)
var (
_ database.Client = (*pgxConn)(nil)
_ database.Migrator = (*pgxConn)(nil)
)
// Release implements [database.Client].
func (c *pgxConn) Release(_ context.Context) error {
@@ -46,3 +50,8 @@ func (c *pgxConn) Exec(ctx context.Context, sql string, args ...any) error {
_, err := c.Conn.Exec(ctx, sql, args...)
return err
}
// Migrate implements [database.Migrator].
func (c *pgxConn) Migrate(ctx context.Context) error {
return migration.Migrate(ctx, c.Conn.Conn())
}