2022-11-18 12:49:38 +00:00
|
|
|
package setup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"database/sql"
|
|
|
|
_ "embed"
|
2024-01-25 16:28:20 +00:00
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
2022-11-18 12:49:38 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
//go:embed 05.sql
|
|
|
|
lastFailedStmts string
|
|
|
|
)
|
|
|
|
|
|
|
|
type LastFailed struct {
|
|
|
|
dbClient *sql.DB
|
|
|
|
}
|
|
|
|
|
2024-01-25 16:28:20 +00:00
|
|
|
func (mig *LastFailed) Execute(ctx context.Context, _ eventstore.Event) error {
|
2022-11-18 12:49:38 +00:00
|
|
|
_, err := mig.dbClient.ExecContext(ctx, lastFailedStmts)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (mig *LastFailed) String() string {
|
|
|
|
return "05_last_failed"
|
|
|
|
}
|