diff --git a/src/ejabberd_sm_sql.erl b/src/ejabberd_sm_sql.erl index df8e0970d57..8ae33a47ff4 100644 --- a/src/ejabberd_sm_sql.erl +++ b/src/ejabberd_sm_sql.erl @@ -49,6 +49,7 @@ init() -> ?DEBUG("Cleaning SQL SM table...", []), lists:foldl( fun(Host, ok) -> + ?INFO_MSG("060 SQL Schema ejabberd_sm_sql:init/0 for host ~p", [ Host ]), %+++ ejabberd_sql_schema:update_schema(Host, ?MODULE, sql_schemas()), case ejabberd_sql:sql_query( Host, ?SQL("delete from sm where node=%(Node)s")) of diff --git a/src/ejabberd_sql_schema.erl b/src/ejabberd_sql_schema.erl index b3a878fd5c1..ea7ee5a3604 100644 --- a/src/ejabberd_sql_schema.erl +++ b/src/ejabberd_sql_schema.erl @@ -36,9 +36,10 @@ -include("ejabberd_ctl.hrl"). start(Host) -> + ?INFO_MSG("001 SQL Schema: start for host ~p!", [Host]), %+++ case should_update_schema(Host) of true -> - ?INFO_MSG("SQL Schema: Let's update it!", []), %+++ + ?INFO_MSG("002 SQL Schema: Let's update it for host ~p!", [Host]), %+++ case table_exists(Host, <<"schema_version">>) of true -> ok; @@ -60,12 +61,12 @@ start(Host) -> [Table#sql_table.name, Error]), {error, Error}; _ -> - ?INFO_MSG("SQL Schema: created succesfully", []), %+++ + ?INFO_MSG("003 SQL Schema: created succesfully", []), %+++ ok end end; false -> - ?INFO_MSG("SQL Schema: Option to update it was disabled", []), %+++ + ?INFO_MSG("005 SQL Schema: I will NOT update schema for host ~p.", [Host]), %+++ ok end. @@ -767,15 +768,21 @@ should_update_schema(Host) -> mysql -> true; _ -> false end, + ?INFO_MSG("010 SQL Schema should_update_schema - SupportedDB: ~p.", [SupportedDB]), %+++ case ejabberd_option:update_sql_schema() andalso SupportedDB of true -> + ?INFO_MSG("011 SQL Schema should_update_schema - update_sql_schema: ~p.", [true]), %+++ case ejabberd_sql:use_new_schema() of true -> + ?INFO_MSG("012 SQL Schema should_update_schema - use_new_schema: ~p.", [true]), %+++ + ?INFO_MSG("013 SQL Schema should_update_schema - comparison: ~p == ~p.", [Host, ejabberd_config:get_myname()]), %+++ Host == ejabberd_config:get_myname(); false -> + ?INFO_MSG("014 SQL Schema should_update_schema - use_new_schema: ~p.", [false]), %+++ true end; false -> + ?INFO_MSG("015 SQL Schema should_update_schema - update_sql_schema: ~p.", [false]), %+++ false end. @@ -833,6 +840,7 @@ preprocess_schemas(SchemaInfo, Schemas) -> end, Schemas). update_schema(Host, Module, RawSchemas) -> + ?INFO_MSG("020 SQL Schema: update_schema/3 for host ~p, Module ~p!", [Host, Module]), %+++ case should_update_schema(Host) of true -> SchemaInfo = @@ -1204,6 +1212,7 @@ print_schema(SDBType, SDBVersion, SNewSchema) -> test() -> + ?INFO_MSG("030 SQL Schema: test/0", []), %+++ Schemas = [#sql_schema{ version = 2,