[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.
- [taler-exchange] 116/130: avoid duplication, (continued)
- [taler-exchange] 116/130: avoid duplication, gnunet, 2021/11/17
- [taler-exchange] 121/130: fix warning, gnunet, 2021/11/17
- [taler-exchange] 113/130: age restriction (load per denomination). 3/n, gnunet, 2021/11/17
- [taler-exchange] 130/130: towards merging with master, gnunet, 2021/11/17
- [taler-exchange] 118/130: -new option, gnunet, 2021/11/17
- [taler-exchange] 77/130: -fixes, gnunet, 2021/11/17
- [taler-exchange] 103/130: comment, gnunet, 2021/11/17
- [taler-exchange] 124/130: fix oauth_username issue, gnunet, 2021/11/17
- [taler-exchange] 115/130: -preparations for long polling support, gnunet, 2021/11/17
- [taler-exchange] 110/130: misc TODOs for KYC left, gnunet, 2021/11/17
- [taler-exchange] 84/130: move extension options to external table,
gnunet <=
- [taler-exchange] 109/130: get first KYC test to pass, gnunet, 2021/11/17
- [taler-exchange] 85/130: include h_extensions in deposit confirmation, gnunet, 2021/11/17
- [taler-exchange] 72/130: abstract denomination keys a bit more, gnunet, 2021/11/17
- [taler-exchange] 105/130: add KYC test skeleton, gnunet, 2021/11/17
- [taler-exchange] 122/130: readme, gnunet, 2021/11/17
- [taler-exchange] 123/130: -fix rval, gnunet, 2021/11/17
- [taler-exchange] 76/130: -brks, gnunet, 2021/11/17
- [taler-exchange] 87/130: SQL fix, gnunet, 2021/11/17
- [taler-exchange] 129/130: towards merging with master, gnunet, 2021/11/17
- [taler-exchange] 81/130: more RSA cleanup, gnunet, 2021/11/17