Skip to content

Commit

Permalink
Merge pull request #573 from Permify/next-v0.4.7
Browse files Browse the repository at this point in the history
fix: max(xid8) to limit version
  • Loading branch information
tolgaOzen committed Jul 4, 2023
2 parents 7b75496 + 163bba2 commit b723338
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/storage/postgres/relationshipReader.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (r *RelationshipReader) HeadSnapshot(ctx context.Context, tenantID string)
var xid types.XID8

// Build the query to find the highest transaction ID associated with the tenant.
builder := r.database.Builder.Select("MAX(id)").From(TransactionsTable).Where(squirrel.Eq{"tenant_id": tenantID})
builder := r.database.Builder.Select("id").From(TransactionsTable).Where(squirrel.Eq{"tenant_id": tenantID}).OrderBy("id DESC").Limit(1)
query, args, err := builder.ToSql()
if err != nil {
span.RecordError(err)
Expand Down

0 comments on commit b723338

Please sign in to comment.