From a50e69908e7205021167415fac42162be96f98d0 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <grothoff@gnunet.org>
Date: Fri, 8 Mar 2024 11:12:50 +0100
Subject: add taler-exchange-dbinit -a option

---
 src/exchangedb/drop.sql | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/exchangedb/drop.sql')

diff --git a/src/exchangedb/drop.sql b/src/exchangedb/drop.sql
index ff383d743..fa7609bfd 100644
--- a/src/exchangedb/drop.sql
+++ b/src/exchangedb/drop.sql
@@ -17,10 +17,18 @@
 -- Everything in one big transaction
 BEGIN;
 
-
+-- TODO: consider use exchange-* in the future!
 SELECT _v.unregister_patch('exchange-0001');
 SELECT _v.unregister_patch('exchange-0002');
 
+WITH xpatches AS (
+  SELECT patch_name
+  FROM _v.patches
+  WHERE patch_name='auditor-triggers-0001' -- TODO: use auditor-triggers-* in the future!
+)
+  SELECT _v.unregister_patch(xpatches.patch_name)
+  FROM xpatches;
+
 DROP SCHEMA exchange CASCADE;
 
 COMMIT;
-- 
cgit v1.2.3

