summaryrefslogtreecommitdiff
path: root/src/exchange-tools/taler-exchange-dbinit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-21 19:22:03 +0200
committerChristian Grothoff <christian@grothoff.org>2016-05-21 19:22:03 +0200
commit8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2 (patch)
tree913b31d9e4c59050d68214298801403e293bf344 /src/exchange-tools/taler-exchange-dbinit.c
parent9160245167ded9b2b7c11716dfa1a1e8887187f4 (diff)
downloadexchange-8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2.tar.gz
exchange-8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2.tar.bz2
exchange-8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2.zip
testing refund, fixing bugs, refund test passes
Diffstat (limited to 'src/exchange-tools/taler-exchange-dbinit.c')
-rw-r--r--src/exchange-tools/taler-exchange-dbinit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c
index e51f5a21..16d76e4d 100644
--- a/src/exchange-tools/taler-exchange-dbinit.c
+++ b/src/exchange-tools/taler-exchange-dbinit.c
@@ -23,13 +23,17 @@
#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.
*
* @param cls closure
@@ -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
};