From 1b4d62e2bc8b146d19a683f0cef936ce706fef79 Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Mon, 9 Dec 2013 05:57:36 +0100 Subject: irc2sql: fixed incorrect usercount for channels and servers after netsplit, fixed not displaying the channelmodes --- modules/stats/irc2sql/tables.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'modules/stats/irc2sql/tables.cpp') diff --git a/modules/stats/irc2sql/tables.cpp b/modules/stats/irc2sql/tables.cpp index 8b339f406..5bbdf9252 100644 --- a/modules/stats/irc2sql/tables.cpp +++ b/modules/stats/irc2sql/tables.cpp @@ -4,15 +4,16 @@ void IRC2SQL::CheckTables() { Anope::string geoquery(""); - /* TODO: remove the DropTable commands when the table layout is done - * perhaps we should drop/recreate some tables by default in case anope crashed - * and was unable to clear the content (ison) - * TRUNCATE could perform better for this? - */ - SQL::Result r; - r = this->sql->RunQuery(SQL::Query("DROP TABLE " + prefix + "user")); - r = this->sql->RunQuery(SQL::Query("DROP TABLE " + prefix + "chan")); - r = this->sql->RunQuery(SQL::Query("DROP TABLE " + prefix + "ison")); + if (firstrun) + { + /* + * drop/recreate some tables in case anope crashed + * and was unable to clear the content (ison) + */ + this->sql->RunQuery(SQL::Query("DROP TABLE " + prefix + "user")); + this->sql->RunQuery(SQL::Query("DROP TABLE " + prefix + "chan")); + this->sql->RunQuery(SQL::Query("DROP TABLE " + prefix + "ison")); + } this->GetTables(); -- cgit