aboutsummaryrefslogtreecommitdiff
path: root/src/auditordb/0002-auditor-triggers.sql
blob: 43d8eb8f65d981738d19bb7e7be2418dfb1ebd22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
SET search_path TO auditor;

CREATE TRIGGER auditor_notify_helper_deposits
    AFTER INSERT
    ON auditor.deposit_confirmations
EXECUTE PROCEDURE auditor_new_transactions_trigger();

CREATE OR REPLACE FUNCTION auditor_new_transactions_trigger()
    RETURNS trigger
    LANGUAGE plpgsql
AS $$
BEGIN
    -- TODO Add correct notify string
    PERFORM('NOTIFY XRE2709K6TYDBVARD9Y5SCZY7VHE4D5DKF0R8DHQ4X5T13E8X2X60');
    RETURN NEW;
END $$;
COMMENT ON FUNCTION auditor_new_transactions_trigger()
    IS 'Call auditor_call_db_notify on new entry';