fix: unique constraint setup step (#1496)

This commit is contained in:
Fabi 2021-03-30 11:42:01 +02:00 committed by GitHub
parent e8e8015aa5
commit 1771ce40b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ func (rm *UniqueConstraintReadModel) Reduce() error {
case *iam.IDPConfigAddedEvent:
rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
case *iam.IDPConfigChangedEvent:
if e.Name != nil {
if e.Name == nil {
continue
}
rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
@ -61,7 +61,7 @@ func (rm *UniqueConstraintReadModel) Reduce() error {
case *org.IDPConfigAddedEvent:
rm.addUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
case *org.IDPConfigChangedEvent:
if e.Name != nil {
if e.Name == nil {
continue
}
rm.changeUniqueConstraint(e.Aggregate().ID, e.ConfigID, idpconfig.NewAddIDPConfigNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))
@ -76,7 +76,7 @@ func (rm *UniqueConstraintReadModel) Reduce() error {
case *project.ProjectAddedEvent:
rm.addUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(e.Name, e.Aggregate().ResourceOwner))
case *project.ProjectChangeEvent:
if e.Name != nil {
if e.Name == nil {
continue
}
rm.changeUniqueConstraint(e.Aggregate().ID, e.Aggregate().ID, project.NewAddProjectNameUniqueConstraint(*e.Name, e.Aggregate().ResourceOwner))