From 46b97d563f4ddf2c3a7ce131df7226b50bcdcb04 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 16 Jun 2019 21:14:41 +0200 Subject: [PATCH] DROP TABLE also DROPs the index so we do not need to do this separately. Signed-off-by: DL6ER --- networktable.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/networktable.c b/networktable.c index 1916aec2..8e7d26f3 100644 --- a/networktable.c +++ b/networktable.c @@ -97,16 +97,7 @@ bool create_network_addresses_table(void) return false; } - // Step 3: Drop unique index in hwaddr before dropping the network table - ret = dbquery("DROP INDEX network_hwaddr_idx;"); - if(!ret) - { - logg("create_network_addresses_table(): DROP INDEX network_hwaddr_idx failed!"); - dbclose(); - return false; - } - - // Step 4: Drop the network table + // Step 3: Drop the network table, the unique index will be automatically dropped ret = dbquery("DROP TABLE network;"); if(!ret) { @@ -116,7 +107,7 @@ bool create_network_addresses_table(void) } - // Step 5: Rename network_bck table to network table as last step + // Step 4: Rename network_bck table to network table as last step ret = dbquery("ALTER TABLE network_bck RENAME TO network;"); if(!ret) {