mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 11:40:16 +00:00
fix(eventstore): correct creation date of events (#5683)
* fix: add setup step to correct creation dates * fix(eventstore): replace now with statement ts * fix(step10): correct number * fix: handle wrong instance domain removed events
This commit is contained in:
@@ -59,12 +59,16 @@ func (wm *SystemConfigWriteModel) Reduce() error {
|
||||
}
|
||||
wm.Instances[e.Aggregate().InstanceID].Domains = append(wm.Instances[e.Aggregate().InstanceID].Domains, e.Domain)
|
||||
case *instance.DomainRemovedEvent:
|
||||
domains := wm.Instances[e.Aggregate().InstanceID].Domains
|
||||
for i, domain := range domains {
|
||||
instance, ok := wm.Instances[e.Aggregate().InstanceID]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
for i, domain := range instance.Domains {
|
||||
if domain == e.Domain {
|
||||
domains[i] = domains[len(domains)-1]
|
||||
domains[len(domains)-1] = ""
|
||||
wm.Instances[e.Aggregate().InstanceID].Domains = domains[:len(domains)-1]
|
||||
instance.Domains[i] = instance.Domains[len(instance.Domains)-1]
|
||||
instance.Domains[len(instance.Domains)-1] = ""
|
||||
wm.Instances[e.Aggregate().InstanceID].Domains = instance.Domains[:len(instance.Domains)-1]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ const (
|
||||
" $2::VARCHAR AS aggregate_type," +
|
||||
" $3::VARCHAR AS aggregate_id," +
|
||||
" $4::VARCHAR AS aggregate_version," +
|
||||
" NOW() AS creation_date," +
|
||||
" statement_timestamp() AS creation_date," +
|
||||
" $5::JSONB AS event_data," +
|
||||
" $6::VARCHAR AS editor_user," +
|
||||
" $7::VARCHAR AS editor_service," +
|
||||
|
Reference in New Issue
Block a user