mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-05 06:32:06 +00:00
feat: handle instanceID in projections (#3442)
* feat: handle instanceID in projections * rename functions * fix key lock * fix import
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
|
||||
"github.com/caos/zitadel/internal/api/authz"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/caos/zitadel/internal/query/projection"
|
||||
)
|
||||
@@ -72,6 +73,7 @@ func (q *Queries) latestSequence(ctx context.Context, projections ...table) (*La
|
||||
}
|
||||
stmt, args, err := query.
|
||||
Where(or).
|
||||
Where(sq.Eq{CurrentSequenceColInstanceID.identifier(): authz.GetInstance(ctx).InstanceID()}).
|
||||
OrderBy(CurrentSequenceColCurrentSequence.identifier()).
|
||||
ToSql()
|
||||
if err != nil {
|
||||
@@ -269,6 +271,10 @@ var (
|
||||
name: "projection_name",
|
||||
table: currentSequencesTable,
|
||||
}
|
||||
CurrentSequenceColInstanceID = Column{
|
||||
name: "instance_id",
|
||||
table: currentSequencesTable,
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user