gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 84/130: move extension options to external table


From: gnunet
Subject: [taler-exchange] 84/130: move extension options to external table
Date: Wed, 17 Nov 2021 12:25:32 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

commit 57acad487de0ecb3f964c83a60e4f2d7d1ec460b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Nov 6 19:04:54 2021 +0100

    move extension options to external table
---
 src/exchangedb/exchange-0001.sql            | 7 ++++++-
 src/exchangedb/irbt_callbacks.c             | 3 ++-
 src/exchangedb/lrbt_callbacks.c             | 6 +++---
 src/exchangedb/plugin_exchangedb_postgres.c | 4 ++--
 src/include/taler_exchangedb_plugin.h       | 2 +-
 5 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/exchange-0001.sql
index d510af78..692a9ce6 100644
--- a/src/exchangedb/exchange-0001.sql
+++ b/src/exchangedb/exchange-0001.sql
@@ -361,6 +361,11 @@ CREATE INDEX IF NOT EXISTS refresh_transfer_keys_coin_tpub
 COMMENT ON INDEX refresh_transfer_keys_coin_tpub
   IS 'for get_link (unsure if this helps or hurts for performance as there 
should be very few transfer public keys per rc, but at least in theory this 
helps the ORDER BY clause)';
 
+CREATE TABLE IF NOT EXISTS extension_details
+  (extension_details_serial_id BIGSERIAL PRIMARY KEY
+  ,extension_options VARCHAR);
+COMMENT ON TABLE extension_details
+  IS 'Extensions that were provided with deposits (not yet used).';
 
 CREATE TABLE IF NOT EXISTS deposits
   (deposit_serial_id BIGSERIAL PRIMARY KEY
@@ -380,7 +385,7 @@ CREATE TABLE IF NOT EXISTS deposits
   ,tiny BOOLEAN NOT NULL DEFAULT FALSE
   ,done BOOLEAN NOT NULL DEFAULT FALSE
   ,extension_blocked BOOLEAN NOT NULL DEFAULT FALSE
-  ,extension_options VARCHAR
+  ,extension_details_serial_id INT8 REFERENCES extension_details 
(extension_details_serial_id)
   ,UNIQUE (known_coin_id, merchant_pub, h_contract_terms)
   );
 COMMENT ON TABLE deposits
diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index 20f25686..8e237543 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -517,7 +517,8 @@ irbt_cb_table_deposits (struct PostgresClosure *pg,
     GNUNET_PQ_query_param_auto_from_type (&tiny),
     GNUNET_PQ_query_param_auto_from_type (&done),
     GNUNET_PQ_query_param_auto_from_type (&extension_blocked),
-    TALER_PQ_query_param_json (td->details.deposits.extension_options),
+    GNUNET_PQ_query_param_uint64 (
+      &td->details.deposits.extension_details_serial_id),
     GNUNET_PQ_query_param_end
   };
 
diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c
index 8aa0a083..60ca4b8b 100644
--- a/src/exchangedb/lrbt_callbacks.c
+++ b/src/exchangedb/lrbt_callbacks.c
@@ -952,9 +952,9 @@ lrbt_cb_table_deposits (void *cls,
       GNUNET_PQ_result_spec_auto_from_type (
         "extension_blocked",
         &td.details.deposits.extension_blocked),
-      TALER_PQ_result_spec_json (
-        "extension_options",
-        &td.details.deposits.extension_options),
+      GNUNET_PQ_result_spec_uint64 (
+        "extension_details_serial_id",
+        &td.details.deposits.extension_details_serial_id),
       GNUNET_PQ_result_spec_end
     };
 
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index 730c58b8..237084ae 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2299,7 +2299,7 @@ prepare_statements (struct PostgresClosure *pg)
       ",tiny"
       ",done"
       ",extension_blocked"
-      ",extension_options"
+      ",extension_details_serial_id"
       " FROM deposits"
       " WHERE deposit_serial_id > $1"
       " ORDER BY deposit_serial_id ASC;",
@@ -2588,7 +2588,7 @@ prepare_statements (struct PostgresClosure *pg)
       ",tiny"
       ",done"
       ",extension_blocked"
-      ",extension_options"
+      ",extension_details_serial_id"
       ") VALUES "
       "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,"
       " $11, $12, $13, $14, $15, $16, $17, $18);",
diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index dcfb7a5d..075024e7 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -328,7 +328,7 @@ struct TALER_EXCHANGEDB_TableData
       bool tiny;
       bool done;
       bool extension_blocked;
-      json_t *extension_options;
+      uint64_t extension_details_serial_id;
     } deposits;
 
     struct

-- 
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]