Fix inconsistent order when pulling autoproxy members

Signed-off-by: Ske <voltasalt@gmail.com>
This commit is contained in:
Ske 2021-06-09 12:23:23 +02:00
parent 0fa13f6e1e
commit 8b948bcfbb

View File

@ -3,7 +3,7 @@ create view system_last_switch as
select systems.id as system, select systems.id as system,
last_switch.id as switch, last_switch.id as switch,
last_switch.timestamp as timestamp, last_switch.timestamp as timestamp,
array(select member from switch_members where switch_members.switch = last_switch.id) as members array(select member from switch_members where switch_members.switch = last_switch.id order by switch_members.id) as members
from systems from systems
inner join lateral (select * from switches where switches.system = systems.id order by timestamp desc limit 1) as last_switch on true; inner join lateral (select * from switches where switches.system = systems.id order by timestamp desc limit 1) as last_switch on true;