aonestar
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_trg_room_after_update_connecting_room
Parameters
Name
Type
Mode
Definition
DECLARE target_id INT; target_connect_rooms INT[]; begin update room r set connect_rooms = coalesce(connect_rooms, '{}') || new.id where r.id = any(new.connect_rooms) and (r.connect_rooms is null or new.id <> all(r.connect_rooms)) and r.id <> new.id ; update room r set connect_rooms = array_remove(r.connect_rooms, new.id) where r.id <> new.id and new.id = any(coalesce(r.connect_rooms, '{}')) and r.id <> all(coalesce(new.connect_rooms, '{}')); RETURN NULL; END;