diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/exchange-0001.sql index d510af789..692a9ce6f 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 20f25686c..8e2375438 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 8aa0a0833..60ca4b8b6 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 730c58b88..237084ae3 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 dcfb7a5d0..075024e73 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