diff options
Diffstat (limited to 'src/backenddb/plugin_merchantdb_postgres.c')
-rw-r--r-- | src/backenddb/plugin_merchantdb_postgres.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c index 5465b4e8..7aad3c7c 100644 --- a/src/backenddb/plugin_merchantdb_postgres.c +++ b/src/backenddb/plugin_merchantdb_postgres.c @@ -1364,6 +1364,8 @@ postgres_lookup_product (void *cls, &pd->address), GNUNET_PQ_result_spec_timestamp ("next_restock", &pd->next_restock), + GNUNET_PQ_result_spec_uint32 ("minimum_age", + &pd->minimum_age), GNUNET_PQ_result_spec_end }; @@ -1433,6 +1435,7 @@ postgres_insert_product (void *cls, GNUNET_PQ_query_param_uint64 (&pd->total_stock), TALER_PQ_query_param_json (pd->address), GNUNET_PQ_query_param_timestamp (&pd->next_restock), + GNUNET_PQ_query_param_uint32 (&pd->minimum_age), GNUNET_PQ_query_param_end }; @@ -1482,6 +1485,7 @@ postgres_update_product (void *cls, GNUNET_PQ_query_param_uint64 (&pd->total_lost), TALER_PQ_query_param_json (pd->address), GNUNET_PQ_query_param_timestamp (&pd->next_restock), + GNUNET_PQ_query_param_uint32 (&pd->minimum_age), GNUNET_PQ_query_param_end }; @@ -6993,6 +6997,7 @@ postgres_connect (void *cls) ",image" ",merchant_inventory.address" ",next_restock" + ",minimum_age" " FROM merchant_inventory" " JOIN merchant_instances" " USING (merchant_serial)" @@ -7027,12 +7032,14 @@ postgres_connect (void *cls) ",price_frac" ",total_stock" ",address" - ",next_restock)" + ",next_restock" + ",minimum_age" + ")" " SELECT merchant_serial," - " $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12" + " $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13" " FROM merchant_instances" " WHERE merchant_id=$1", - 12), + 13), /* for postgres_update_product() */ GNUNET_PQ_make_prepare ("update_product", "UPDATE merchant_inventory SET" @@ -7047,6 +7054,7 @@ postgres_connect (void *cls) ",total_lost=$11" ",address=$12" ",next_restock=$13" + ",minimum_age=$14" " WHERE merchant_serial=" " (SELECT merchant_serial" " FROM merchant_instances" @@ -7054,7 +7062,7 @@ postgres_connect (void *cls) " AND product_id=$2" " AND total_stock <= $10" " AND total_lost <= $11", - 13), + 14), /* for postgres_lock_product() */ GNUNET_PQ_make_prepare ("lock_product", |