aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index e03713c3..ebac70ea 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -3932,20 +3932,29 @@ prepare_statements (struct PostgresClosure *pg)
"(policy_details_serial_id"
",serial_id"
",policy_options"
- ",fulfilment_serial_id"
+ ",deadline"
+ ",fulfilment_state"
") VALUES "
- "($1, $2, $3, $4);",
- 4),
+ "($1, $2, $3, $4, $5);",
+ 5),
GNUNET_PQ_make_prepare (
"insert_into_table_policy_fulfilments",
"INSERT INTO policy_fulfilments"
- "(policy_fulfilments_serial_id"
+ "(fulfilment_id"
",fulfilment_timestamp"
",fulfilment_proof"
") VALUES "
"($1, $2, $3);",
3),
GNUNET_PQ_make_prepare (
+ "insert_into_table_policy_details_fulfilments",
+ "INSERT INTO policy_details_fulfilments"
+ "(fulfilment_id"
+ ",serial_id"
+ ") VALUES "
+ "($1, $2);",
+ 2),
+ GNUNET_PQ_make_prepare (
"insert_into_table_purse_requests",
"INSERT INTO purse_requests"
"(purse_requests_serial_id"
@@ -6273,16 +6282,16 @@ postgres_do_deposit (
GNUNET_PQ_query_param_auto_from_type (&deposit->coin.coin_pub),
GNUNET_PQ_query_param_auto_from_type (&deposit->csig),
GNUNET_PQ_query_param_uint64 (&deposit_shard),
- GNUNET_PQ_query_param_bool (! deposit->no_policy_details),
- (deposit->no_policy_details)
- ? GNUNET_PQ_query_param_null ()
- : TALER_PQ_query_param_json (deposit->policy_details),
- (deposit->no_policy_details)
- ? GNUNET_PQ_query_param_null ()
- : GNUNET_PQ_query_param_auto_from_type (&deposit->policy_serial_id),
- (deposit->no_policy_details)
- ? GNUNET_PQ_query_param_null ()
- : GNUNET_PQ_query_param_timestamp (&deposit->policy_deadline),
+ GNUNET_PQ_query_param_bool (deposit->has_policy_details),
+ (deposit->has_policy_details)
+ ? TALER_PQ_query_param_json (deposit->policy_details)
+ : GNUNET_PQ_query_param_null (),
+ (deposit->has_policy_details)
+ ? GNUNET_PQ_query_param_auto_from_type (&deposit->policy_serial_id)
+ : GNUNET_PQ_query_param_null (),
+ (deposit->has_policy_details)
+ ? GNUNET_PQ_query_param_timestamp (&deposit->policy_deadline)
+ : GNUNET_PQ_query_param_null (),
GNUNET_PQ_query_param_end
};
struct GNUNET_PQ_ResultSpec rs[] = {