mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-25 13:58:46 +00:00
fix: add order by for max previous sequence (#1501)
This commit is contained in:
@@ -39,8 +39,8 @@ const (
|
|||||||
" WITH previous_data AS (" +
|
" WITH previous_data AS (" +
|
||||||
" SELECT MAX(event_sequence) AS seq, resource_owner " +
|
" SELECT MAX(event_sequence) AS seq, resource_owner " +
|
||||||
" FROM eventstore.events " +
|
" FROM eventstore.events " +
|
||||||
//TODO: remove LIMIT 1 as soon as data cleaned up (only 1 resource_owner per aggregate)
|
//TODO: remove LIMIT 1 / order by as soon as data cleaned up (only 1 resource_owner per aggregate)
|
||||||
" WHERE aggregate_type = $2 AND aggregate_id = $3 GROUP BY resource_owner LIMIT 1" +
|
" WHERE aggregate_type = $2 AND aggregate_id = $3 GROUP BY resource_owner order by seq desc LIMIT 1" +
|
||||||
" )" +
|
" )" +
|
||||||
// defines the data to be inserted
|
// defines the data to be inserted
|
||||||
" SELECT " +
|
" SELECT " +
|
||||||
|
|||||||
Reference in New Issue
Block a user