mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
fix: user projection (#2795)
* fix: first- and lastname changes on user * add reset migration
This commit is contained in:
parent
f0a77e80bf
commit
2ad03285f1
@ -5,6 +5,7 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/caos/logging"
|
"github.com/caos/logging"
|
||||||
|
|
||||||
"github.com/caos/zitadel/internal/domain"
|
"github.com/caos/zitadel/internal/domain"
|
||||||
"github.com/caos/zitadel/internal/errors"
|
"github.com/caos/zitadel/internal/errors"
|
||||||
"github.com/caos/zitadel/internal/eventstore"
|
"github.com/caos/zitadel/internal/eventstore"
|
||||||
@ -379,10 +380,13 @@ func (p *UserProjection) reduceHumanProfileChanged(event eventstore.EventReader)
|
|||||||
return nil, errors.ThrowInvalidArgument(nil, "HANDL-769v4", "reduce.wrong.event.type")
|
return nil, errors.ThrowInvalidArgument(nil, "HANDL-769v4", "reduce.wrong.event.type")
|
||||||
}
|
}
|
||||||
cols := make([]handler.Column, 0, 6)
|
cols := make([]handler.Column, 0, 6)
|
||||||
cols = append(cols,
|
if e.FirstName != "" {
|
||||||
handler.NewCol(HumanFistNameCol, e.FirstName),
|
cols = append(cols, handler.NewCol(HumanFistNameCol, e.FirstName))
|
||||||
handler.NewCol(HumanLastNameCol, e.LastName),
|
}
|
||||||
)
|
|
||||||
|
if e.LastName != "" {
|
||||||
|
cols = append(cols, handler.NewCol(HumanLastNameCol, e.LastName))
|
||||||
|
}
|
||||||
|
|
||||||
if e.NickName != nil {
|
if e.NickName != nil {
|
||||||
cols = append(cols, handler.NewCol(HumanNickNameCol, *e.NickName))
|
cols = append(cols, handler.NewCol(HumanNickNameCol, *e.NickName))
|
||||||
|
2
migrations/cockroach/V1.99__reset_user_projections.sql
Normal file
2
migrations/cockroach/V1.99__reset_user_projections.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
truncate zitadel.projections.users cascade;
|
||||||
|
update zitadel.projections.current_sequences set current_sequence = 0 where projection_name = 'zitadel.projections.users';
|
Loading…
Reference in New Issue
Block a user