chore: remove unused system_fronters view
This commit is contained in:
parent
f9abcc68c4
commit
831b6d3301
@ -7,25 +7,6 @@ select systems.id as system,
|
|||||||
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;
|
||||||
|
|
||||||
-- 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
|
create view member_list as
|
||||||
select members.*,
|
select members.*,
|
||||||
-- Find last message ID
|
-- Find last message ID
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
-- This does mean we can't use any functions in row triggers, etc. Still unsure how to handle this.
|
-- 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_last_switch;
|
||||||
drop view if exists system_fronters;
|
|
||||||
drop view if exists member_list;
|
drop view if exists member_list;
|
||||||
drop view if exists group_list;
|
drop view if exists group_list;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user