2023-08-15 12:47:05 +00:00
|
|
|
package setup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
_ "embed"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
2024-01-25 16:28:20 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
2023-08-15 12:47:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
//go:embed 12/12_add_otp_columns.sql
|
|
|
|
addOTPColumns string
|
|
|
|
)
|
|
|
|
|
|
|
|
type AddOTPColumns struct {
|
|
|
|
dbClient *database.DB
|
|
|
|
}
|
|
|
|
|
2024-01-25 16:28:20 +00:00
|
|
|
func (mig *AddOTPColumns) Execute(ctx context.Context, _ eventstore.Event) error {
|
2023-08-15 12:47:05 +00:00
|
|
|
_, err := mig.dbClient.ExecContext(ctx, addOTPColumns)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (mig *AddOTPColumns) String() string {
|
|
|
|
return "12_auth_users_otp_columns"
|
|
|
|
}
|