mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
15 lines
471 B
Plaintext
15 lines
471 B
Plaintext
![]() |
create or replace function public.webhook_notify() returns trigger as
|
||
|
$BODY$
|
||
|
begin
|
||
|
IF (TG_OP = 'DELETE') THEN
|
||
|
perform pg_notify('webhookupdates', concat('REMOVE ', old.wiki));
|
||
|
ELSIF (TG_OP = 'INSERT') then
|
||
|
perform pg_notify('webhookupdates', concat('ADD ', new.wiki));
|
||
|
end if;
|
||
|
return new;
|
||
|
end;
|
||
|
$BODY$
|
||
|
language plpgsql;
|
||
|
|
||
|
CREATE TRIGGER RCGCDB_WEBHOOK_UPDATE BEFORE INSERT OR DELETE ON rcgcdw
|
||
|
FOR EACH ROW EXECUTE FUNCTION webhook_notify();
|