oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1CREATE TRIGGER equipo_id_member_delete AFTER DELETE ON members BEGIN
2 DELETE FROM sessions WHERE method='oficina-id' AND subject IN (SELECT subject FROM home_identity_links WHERE person_id IN (SELECT id FROM equipo_id_accounts WHERE member_key=OLD.identity_key));
3 DELETE FROM home_identity_links WHERE person_id IN (SELECT id FROM equipo_id_accounts WHERE member_key=OLD.identity_key);
4 DELETE FROM equipo_id_reauth WHERE account_id IN (SELECT id FROM equipo_id_accounts WHERE member_key=OLD.identity_key);
5 DELETE FROM equipo_id_accounts WHERE member_key=OLD.identity_key;
6 DELETE FROM home_link_flows;
7 DELETE FROM oficina_handoff_pending;
8 DELETE FROM oficina_handoff_inbox;
9END;
10CREATE TRIGGER equipo_id_member_change AFTER UPDATE OF address ON members WHEN OLD.address<>NEW.address BEGIN
11 DELETE FROM sessions WHERE method='oficina-id' AND subject IN (SELECT subject FROM home_identity_links WHERE person_id IN (SELECT id FROM equipo_id_accounts WHERE member_key=OLD.identity_key));
12 DELETE FROM home_identity_links WHERE person_id IN (SELECT id FROM equipo_id_accounts WHERE member_key=OLD.identity_key);
13 DELETE FROM equipo_id_reauth WHERE account_id IN (SELECT id FROM equipo_id_accounts WHERE member_key=OLD.identity_key);
14 DELETE FROM equipo_id_accounts WHERE member_key=OLD.identity_key;
15 DELETE FROM home_link_flows;
16 DELETE FROM oficina_handoff_pending;
17 DELETE FROM oficina_handoff_inbox;
18END;
19