From 8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 21 May 2016 19:22:03 +0200 Subject: testing refund, fixing bugs, refund test passes --- src/exchange-tools/taler-exchange-dbinit.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/exchange-tools/taler-exchange-dbinit.c') diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c index e51f5a21a..16d76e4d0 100644 --- a/src/exchange-tools/taler-exchange-dbinit.c +++ b/src/exchange-tools/taler-exchange-dbinit.c @@ -23,12 +23,16 @@ #include "taler_exchangedb_plugin.h" - /** * Return value from main(). */ static int global_ret; +/** + * -r option: do full DB reset + */ +static int reset_db; + /** * Main function that will be run. * @@ -53,6 +57,8 @@ run (void *cls, global_ret = 1; return; } + if (reset_db) + (void) plugin->drop_tables (plugin->cls); if (GNUNET_OK != plugin->create_tables (plugin->cls)) { @@ -79,6 +85,9 @@ main (int argc, char *const *argv) { const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'r', "reset", NULL, + "reset database (DANGEROUS: all existing data is lost!)", 0, + &GNUNET_GETOPT_set_one, &reset_db}, GNUNET_GETOPT_OPTION_END }; -- cgit v1.2.3