summaryrefslogtreecommitdiff
path: root/maintenance/postgres/archives/patch-page_deleted.sql
blob: 5b0782cbeee1eaf1f35a6850ff0065b5917b5cf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
CREATE FUNCTION page_deleted() RETURNS TRIGGER LANGUAGE plpgsql AS
$mw$
BEGIN
DELETE FROM recentchanges WHERE rc_namespace = OLD.page_namespace AND rc_title = OLD.page_title;
RETURN NULL;
END;
$mw$;

CREATE TRIGGER page_deleted AFTER DELETE ON page
  FOR EACH ROW EXECUTE PROCEDURE page_deleted();