mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
feat: add tenant column to eventstore (#3314)
* feat: add tenant column to eventstore * feat: read tenant from context on push and filter * Update 07_events_table.sql * pass tenant to queryFactory * fix some query tests * init in tests * add missing sql files Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ type WriteModel struct {
|
||||
ProcessedSequence uint64 `json:"-"`
|
||||
Events []Event `json:"-"`
|
||||
ResourceOwner string `json:"-"`
|
||||
Tenant string `json:"-"`
|
||||
ChangeDate time.Time `json:"-"`
|
||||
}
|
||||
|
||||
@@ -32,6 +33,9 @@ func (wm *WriteModel) Reduce() error {
|
||||
if wm.ResourceOwner == "" {
|
||||
wm.ResourceOwner = wm.Events[0].Aggregate().ResourceOwner
|
||||
}
|
||||
if wm.Tenant == "" {
|
||||
wm.Tenant = wm.Events[0].Aggregate().Tenant
|
||||
}
|
||||
|
||||
wm.ProcessedSequence = wm.Events[len(wm.Events)-1].Sequence()
|
||||
wm.ChangeDate = wm.Events[len(wm.Events)-1].CreationDate()
|
||||
|
Reference in New Issue
Block a user