mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 05:17:33 +00:00
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:
@@ -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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user