chore: remove unused system_fronters view

This commit is contained in:
spiral 2022-12-01 11:54:13 +00:00
parent f9abcc68c4
commit 831b6d3301
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E
2 changed files with 0 additions and 20 deletions

View File

@ -7,25 +7,6 @@ select systems.id as system,
from systems
inner join lateral (select * from switches where switches.system = systems.id order by timestamp desc limit 1) as last_switch on true;
-- Returns one row for every current fronter in a system, w/ some member info
create view system_fronters as
select
systems.id as system_id,
last_switch.id as switch_id,
last_switch.timestamp as switch_timestamp,
members.id as member_id,
members.hid as member_hid,
members.name as member_name
from systems
-- TODO: is there a more efficient way of doing this search? might need to index on timestamp if we haven't in prod
inner join lateral (select * from switches where switches.system = systems.id order by timestamp desc limit 1) as last_switch on true
-- change to left join to handle memberless switches?
inner join switch_members on switch_members.switch = last_switch.system
inner join members on members.id = switch_members.member
-- return them in order of the switch itself
order by switch_members.id;
create view member_list as
select members.*,
-- Find last message ID

View File

@ -3,7 +3,6 @@
-- This does mean we can't use any functions in row triggers, etc. Still unsure how to handle this.
drop view if exists system_last_switch;
drop view if exists system_fronters;
drop view if exists member_list;
drop view if exists group_list;