summaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-11-27 21:21:04 +0100
committerChristian Grothoff <christian@grothoff.org>2022-11-27 21:21:04 +0100
commitcf2e37cd876651e799893e8fe5babb51a9e12dd7 (patch)
tree437047cc646fb1a3a86f4226fd5460bbe2b0c530 /src/exchange-tools
parentf2ba02aab2b9bbd976107ecc4ac7e7d657a9d73a (diff)
downloadexchange-cf2e37cd876651e799893e8fe5babb51a9e12dd7.tar.gz
exchange-cf2e37cd876651e799893e8fe5babb51a9e12dd7.tar.bz2
exchange-cf2e37cd876651e799893e8fe5babb51a9e12dd7.zip
more work on SQL refactoring
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/taler-exchange-dbinit.c29
1 files changed, 3 insertions, 26 deletions
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 !=