mirror of
https://github.com/zitadel/zitadel.git
synced 2025-04-23 09:41:31 +00:00
fix: add order by for max previous sequence (#1501)
This commit is contained in:
parent
c6ea230a56
commit
fa6fb92c7e
@ -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 " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user