aboutsummaryrefslogtreecommitdiff
path: root/src/auditordb
diff options
context:
space:
mode:
authorNic <nic@eigel.ch>2024-01-10 21:35:57 +0100
committerNic <nic@eigel.ch>2024-01-10 21:35:57 +0100
commit2ce18dd2db0358d0366e1d817ee4fdb1aae4ef5c (patch)
treefd636585b356dfc08ededf9dcb2236a8d7a0155d /src/auditordb
parent7bdf02db66c618ead83079efa739da968d65b7b5 (diff)
fixing deposit_confirmations db event
Diffstat (limited to 'src/auditordb')
-rw-r--r--src/auditordb/0002-auditor-triggers.sql20
-rw-r--r--src/auditordb/0002-auditor_deposit_confirmations.sql18
2 files changed, 17 insertions, 21 deletions
diff --git a/src/auditordb/0002-auditor-triggers.sql b/src/auditordb/0002-auditor-triggers.sql
deleted file mode 100644
index ce4b66b7b..000000000
--- a/src/auditordb/0002-auditor-triggers.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-SET search_path TO auditor;
-
-CREATE OR REPLACE FUNCTION auditor_new_transactions_trigger()
- RETURNS trigger
- LANGUAGE plpgsql
-AS $$
-BEGIN
- -- TODO Add correct notify string
- NOTIFY XRE2709K6TYDBVARD9Y5SCZY7VHE4D5DKF0R8DHQ4X5T13E8X2X60;
- RETURN NEW;
-END $$;
-COMMENT ON FUNCTION auditor_new_transactions_trigger()
- IS 'Call auditor_call_db_notify on new entry';
-
-
-CREATE TRIGGER auditor_notify_helper_deposits
- AFTER INSERT
- ON auditor.deposit_confirmations
-EXECUTE PROCEDURE auditor_new_transactions_trigger();
-
diff --git a/src/auditordb/0002-auditor_deposit_confirmations.sql b/src/auditordb/0002-auditor_deposit_confirmations.sql
index a0725925c..dd85c0a62 100644
--- a/src/auditordb/0002-auditor_deposit_confirmations.sql
+++ b/src/auditordb/0002-auditor_deposit_confirmations.sql
@@ -41,4 +41,20 @@ COMMENT ON TABLE auditor_deposit_confirmations
CREATE INDEX IF NOT EXISTS auditor_deposit_confirmations_not_ancient
ON auditor_deposit_confirmations
(exchange_timestamp ASC)
- WHERE NOT ancient; \ No newline at end of file
+ WHERE NOT ancient;
+
+CREATE OR REPLACE FUNCTION auditor_new_transactions_trigger()
+ RETURNS trigger
+ LANGUAGE plpgsql
+AS $$
+BEGIN
+ NOTIFY XX81AFHF88YGN6ESNH39KR5VQE9MHD7GSSNMTCXB82SZ6T99ARHE0;
+ RETURN NEW;
+END $$;
+COMMENT ON FUNCTION auditor_new_transactions_trigger()
+ IS 'Call auditor_call_db_notify on new entry';
+
+CREATE TRIGGER auditor_notify_helper_deposits
+ AFTER INSERT
+ ON auditor.deposit_confirmations
+EXECUTE PROCEDURE auditor_new_transactions_trigger(); \ No newline at end of file