mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-06 14:37:41 +00:00
fix(step11): execute step 10 to make sure events are in correct order
This commit is contained in:
parent
defa429eb7
commit
4d7a733e11
@ -13,10 +13,16 @@ var (
|
||||
)
|
||||
|
||||
type AddEventCreatedAt struct {
|
||||
step10 *CorrectCreationDate
|
||||
dbClient *database.DB
|
||||
}
|
||||
|
||||
func (mig *AddEventCreatedAt) Execute(ctx context.Context) error {
|
||||
// execute step 10 again because events created after the first execution of step 10
|
||||
// could still have the wrong ordering of sequences and creation date
|
||||
if err := mig.step10.Execute(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := mig.dbClient.ExecContext(ctx, addEventCreatedAt)
|
||||
return err
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ func Setup(config *Config, steps *Steps, masterKey string) {
|
||||
steps.s8AuthTokens = &AuthTokenIndexes{dbClient: dbClient}
|
||||
steps.s9EventstoreIndexes2 = New09(dbClient)
|
||||
steps.CorrectCreationDate.dbClient = dbClient
|
||||
steps.s11AddEventCreatedAt = &AddEventCreatedAt{dbClient: dbClient}
|
||||
steps.s11AddEventCreatedAt = &AddEventCreatedAt{dbClient: dbClient, step10: steps.CorrectCreationDate}
|
||||
|
||||
err = projection.Create(ctx, dbClient, eventstoreClient, config.Projections, nil, nil)
|
||||
logging.OnError(err).Fatal("unable to start projections")
|
||||
|
Loading…
x
Reference in New Issue
Block a user