fix(handler): allow uint32 offset for migration scenarios (#7103)

This commit is contained in:
Silvan
2023-12-21 11:40:51 +01:00
committed by GitHub
parent ab2c3f7752
commit 5ce542b959
4 changed files with 10 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ type state struct {
aggregateType eventstore.AggregateType
aggregateID string
sequence uint64
offset uint16
offset uint32
}
var (
@@ -46,7 +46,7 @@ func (h *Handler) currentState(ctx context.Context, tx *sql.Tx, config *triggerC
sequence = new(sql.NullInt64)
timestamp = new(sql.NullTime)
position = new(sql.NullFloat64)
offset = new(sql.NullInt16)
offset = new(sql.NullInt64)
)
stateQuery := currentStateStmt
@@ -76,7 +76,8 @@ func (h *Handler) currentState(ctx context.Context, tx *sql.Tx, config *triggerC
currentState.sequence = uint64(sequence.Int64)
currentState.eventTimestamp = timestamp.Time
currentState.position = position.Float64
currentState.offset = uint16(offset.Int16)
// psql does not provide unsigned numbers so we work around it
currentState.offset = uint32(offset.Int64)
return currentState, nil
}