mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +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 (" +
|
||||
" SELECT MAX(event_sequence) AS seq, resource_owner " +
|
||||
" FROM eventstore.events " +
|
||||
//TODO: remove LIMIT 1 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" +
|
||||
//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 order by seq desc LIMIT 1" +
|
||||
" )" +
|
||||
// defines the data to be inserted
|
||||
" SELECT " +
|
||||
|
Loading…
Reference in New Issue
Block a user