summaryrefslogtreecommitdiff
path: root/src/exchangedb/0002-recoup.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-09-16 14:04:36 +0200
committerChristian Grothoff <christian@grothoff.org>2023-09-16 14:04:36 +0200
commit94a313d74b403f7afa130a999ab2171414f86a46 (patch)
tree74a5b4cdaaf84d93e89a56372bbac51673d1bbb6 /src/exchangedb/0002-recoup.sql
parent82f353ce4e3c19f01fcf078b76ae613550673c75 (diff)
downloadexchange-94a313d74b403f7afa130a999ab2171414f86a46.tar.gz
exchange-94a313d74b403f7afa130a999ab2171414f86a46.tar.bz2
exchange-94a313d74b403f7afa130a999ab2171414f86a46.zip
create coin history table via triggers
Diffstat (limited to 'src/exchangedb/0002-recoup.sql')
-rw-r--r--src/exchangedb/0002-recoup.sql14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/exchangedb/0002-recoup.sql b/src/exchangedb/0002-recoup.sql
index c3f96f498..600091b61 100644
--- a/src/exchangedb/0002-recoup.sql
+++ b/src/exchangedb/0002-recoup.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 Taler Systems SA
--
-- TALER is free software; you can redistribute it and/or modify it under the
-- terms of the GNU General Public License as published by the Free Software
@@ -171,10 +171,18 @@ BEGIN
VALUES
(NEW.reserve_out_serial_id
,NEW.coin_pub);
- RETURN NEW;
+ INSERT INTO exchange.coin_history
+ (coin_pub
+ ,table_name
+ ,serial_id)
+ VALUES
+ (NEW.coin_pub
+ ,'recoup'
+ ,NEW.recoup_uuid);
+ RETURN NEW;
END $$;
COMMENT ON FUNCTION recoup_insert_trigger()
- IS 'Replicate recoup inserts into recoup_by_reserve table.';
+ IS 'Replicates recoup inserts into recoup_by_reserve table and updates the coin_history table.';
CREATE FUNCTION recoup_delete_trigger()