Fix inconsistent order when pulling autoproxy members
Signed-off-by: Ske <voltasalt@gmail.com>
This commit is contained in:
		@@ -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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user