mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-25 21:36:26 +00:00
# Which Problems Are Solved
Depending on the metadata values (already existing), the newly created
index (#10415) cannot be created or error in the future.
# How the Problems Are Solved
- Create the index using `sha256` and change the query to use sha256 as
well when comparing bytes values such as user_metadata.
- Added a setup step to cleanup potentially created index on
`projections.user_metadata5`
# Additional Changes
None
# Additional Context
- relates to #10415
- requires backport to v4.x
(cherry picked from commit 57e8033b6e)
28 lines
524 B
Go
28 lines
524 B
Go
package setup
|
|
|
|
import (
|
|
"context"
|
|
_ "embed"
|
|
|
|
"github.com/zitadel/zitadel/internal/database"
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
)
|
|
|
|
var (
|
|
//go:embed 65.sql
|
|
userMetadata5Index string
|
|
)
|
|
|
|
type FixUserMetadata5Index struct {
|
|
dbClient *database.DB
|
|
}
|
|
|
|
func (mig *FixUserMetadata5Index) Execute(ctx context.Context, _ eventstore.Event) error {
|
|
_, err := mig.dbClient.ExecContext(ctx, userMetadata5Index)
|
|
return err
|
|
}
|
|
|
|
func (mig *FixUserMetadata5Index) String() string {
|
|
return "65_fix_user_metadata5_index"
|
|
}
|