gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] 46/130: sql fixes


From: gnunet
Subject: [taler-exchange] 46/130: sql fixes
Date: Wed, 17 Nov 2021 12:24:54 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

commit 22e7dabef196b968ae78333cf7e760bef16b2490
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Oct 29 19:13:47 2021 +0200

    sql fixes
---
 src/exchangedb/drop0001.sql                 | 17 +++--------------
 src/exchangedb/plugin_exchangedb_postgres.c | 13 +++++++------
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/exchangedb/drop0001.sql b/src/exchangedb/drop0001.sql
index 507393e5..54338f02 100644
--- a/src/exchangedb/drop0001.sql
+++ b/src/exchangedb/drop0001.sql
@@ -1,6 +1,6 @@
 --
 -- This file is part of TALER
--- Copyright (C) 2014--2020 Taler Systems SA
+-- Copyright (C) 2014--2021 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
@@ -22,25 +22,20 @@ BEGIN;
 -- Unlike the other SQL files, it SHOULD be updated to reflect the
 -- latest requirements for dropping tables.
 
-
--- Drops for exchange-0003.sql
+-- Drops for exchange-0001.sql
 DROP TABLE IF EXISTS revolving_work_shards CASCADE;
-
-
--- Drops for exchange-0002.sql
 DROP TABLE IF EXISTS auditors CASCADE;
 DROP TABLE IF EXISTS auditor_denom_sigs CASCADE;
 DROP TABLE IF EXISTS exchange_sign_keys CASCADE;
 DROP TABLE IF EXISTS wire_accounts CASCADE;
 DROP TABLE IF EXISTS signkey_revocations CASCADE;
 DROP TABLE IF EXISTS work_shards CASCADE;
-
--- Drops for 0001.sql
 DROP TABLE IF EXISTS prewire CASCADE;
 DROP TABLE IF EXISTS recoup CASCADE;
 DROP TABLE IF EXISTS recoup_refresh CASCADE;
 DROP TABLE IF EXISTS aggregation_tracking CASCADE;
 DROP TABLE IF EXISTS wire_out CASCADE;
+DROP TABLE IF EXISTS wire_targets CASCADE;
 DROP TABLE IF EXISTS wire_fee CASCADE;
 DROP TABLE IF EXISTS deposits CASCADE;
 DROP TABLE IF EXISTS refunds CASCADE;
@@ -59,11 +54,5 @@ DROP TABLE IF EXISTS denominations CASCADE;
 -- Unregister patch (exchange-0001.sql)
 SELECT _v.unregister_patch('exchange-0001');
 
--- Unregister patch (exchange-0002.sql)
-SELECT _v.unregister_patch('exchange-0002');
-
--- Unregister patch (exchange-0003.sql)
-SELECT _v.unregister_patch('exchange-0003');
-
 -- And we're out of here...
 COMMIT;
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index 27870f52..ab84ddfc 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -361,8 +361,9 @@ prepare_statements (struct PostgresClosure *pg)
                             ",kyc_ok"
                             ",wire_target_serial_id AS payment_target_uuid"
                             " FROM reserves"
-                            " JOIN reserves_in USING (reserve_uuid)"
-                            " JOIN wire_targets USING (wire_target_serial_id)"
+                            " JOIN reserves_in ri USING (reserve_uuid)"
+                            " JOIN wire_targets wt "
+                            "  ON (ri.wire_source_serial_id = 
wt.wire_target_serial_id)"
                             " WHERE reserve_pub=$1"
                             " LIMIT 1;",
                             1),
@@ -375,7 +376,7 @@ prepare_statements (struct PostgresClosure *pg)
     /* Used in #postgres_get_kyc_status() */
     GNUNET_PQ_make_prepare ("get_kyc_status",
                             "SELECT"
-                            ",kyc_ok"
+                            " kyc_ok"
                             ",wire_target_serial_id AS payment_target_uuid"
                             " FROM wire_targets"
                             " WHERE payto_uri=$1"
@@ -384,7 +385,7 @@ prepare_statements (struct PostgresClosure *pg)
     /* Used in #postgres_select_kyc_status() */
     GNUNET_PQ_make_prepare ("select_kyc_status",
                             "SELECT"
-                            ",kyc_ok"
+                            " kyc_ok"
                             ",h_payto"
                             " FROM wire_targets"
                             " WHERE"
@@ -400,10 +401,10 @@ prepare_statements (struct PostgresClosure *pg)
                             ") VALUES "
                             "($1)"
                             " ON CONFLICT (wire_target_serial_id) DO "
-                            " (SELECT "
+                            "(SELECT "
                             "  kyc_ok"
                             " ,wire_target_serial_id"
-                            " )"
+                            ")"
                             " RETURNING "
                             "   FALSE AS kyc_ok"
                             "   wire_target_serial_id;",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]