mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:37:31 +00:00
fix: fix and improve primary keys on projections (#3708)
* fix: org_domain projection * fix: projection reset * fix test * improve foreign keys on suffixed tables
This commit is contained in:
@@ -35,7 +35,7 @@ func NewSMTPConfigProjection(ctx context.Context, config crdb.StatementHandlerCo
|
||||
p := new(SMTPConfigProjection)
|
||||
config.ProjectionName = SMTPConfigProjectionTable
|
||||
config.Reducers = p.reducers()
|
||||
config.InitCheck = crdb.NewMultiTableCheck(
|
||||
config.InitCheck = crdb.NewTableCheck(
|
||||
crdb.NewTable([]*crdb.Column{
|
||||
crdb.NewColumn(SMTPConfigColumnAggregateID, crdb.ColumnTypeText),
|
||||
crdb.NewColumn(SMTPConfigColumnCreationDate, crdb.ColumnTypeTimestamp),
|
||||
@@ -132,6 +132,7 @@ func (p *SMTPConfigProjection) reduceSMTPConfigChanged(event eventstore.Event) (
|
||||
columns,
|
||||
[]handler.Condition{
|
||||
handler.NewCond(SMTPConfigColumnAggregateID, e.Aggregate().ID),
|
||||
handler.NewCond(SMTPConfigColumnInstanceID, e.Aggregate().InstanceID),
|
||||
},
|
||||
), nil
|
||||
}
|
||||
@@ -151,6 +152,7 @@ func (p *SMTPConfigProjection) reduceSMTPConfigPasswordChanged(event eventstore.
|
||||
},
|
||||
[]handler.Condition{
|
||||
handler.NewCond(SMTPConfigColumnAggregateID, e.Aggregate().ID),
|
||||
handler.NewCond(SMTPConfigColumnInstanceID, e.Aggregate().InstanceID),
|
||||
},
|
||||
), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user