From cf2e37cd876651e799893e8fe5babb51a9e12dd7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 27 Nov 2022 21:21:04 +0100 Subject: more work on SQL refactoring --- src/exchange-tools/taler-exchange-dbinit.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'src/exchange-tools') diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c index db3d65a29..af4f381fa 100644 --- a/src/exchange-tools/taler-exchange-dbinit.c +++ b/src/exchange-tools/taler-exchange-dbinit.c @@ -91,7 +91,9 @@ run (void *cls, } } if (GNUNET_OK != - plugin->create_tables (plugin->cls)) + plugin->create_tables (plugin->cls, + force_create_partitions || num_partitions > 0, + num_partitions)) { fprintf (stderr, "Failed to initialize database.\n"); @@ -100,31 +102,6 @@ run (void *cls, global_ret = EXIT_NOPERMISSION; return; } - if (1 < - num_partitions - || ( - 1 == num_partitions - && force_create_partitions)) - { - enum GNUNET_GenericReturnValue r = GNUNET_OK; - - r = plugin->setup_partitions (plugin->cls, - num_partitions); - if (GNUNET_OK != r) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Could not setup partitions. Dropping default ones again\n"); - if (GNUNET_OK != plugin->drop_tables (plugin->cls)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Could not drop tables after failed partitioning, please delete the DB manually\n"); - } - TALER_EXCHANGEDB_plugin_unload (plugin); - plugin = NULL; - global_ret = EXIT_NOTINSTALLED; - return; - } - } if (gc_db || clear_shards) { if (GNUNET_OK != -- cgit v1.2.3