1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 17:59:31 +02:00

Add print_sql_schema ejabberdctl command

This commit is contained in:
Alexey Shchepin 2024-01-24 22:49:59 +03:00
parent 6eff14a71d
commit 66d701e788
26 changed files with 293 additions and 139 deletions

View file

@ -34,6 +34,7 @@
get_sessions/0,
get_sessions/1,
get_sessions/2]).
-export([sql_schemas/0]).
-include("ejabberd_sm.hrl").
-include("logger.hrl").
@ -48,7 +49,7 @@ init() ->
?DEBUG("Cleaning SQL SM table...", []),
lists:foldl(
fun(Host, ok) ->
ejabberd_sql_schema:update_schema(Host, ?MODULE, schemas()),
ejabberd_sql_schema:update_schema(Host, ?MODULE, sql_schemas()),
case ejabberd_sql:sql_query(
Host, ?SQL("delete from sm where node=%(Node)s")) of
{updated, _} ->
@ -61,7 +62,7 @@ init() ->
Err
end, ok, ejabberd_sm:get_vh_by_backend(?MODULE)).
schemas() ->
sql_schemas() ->
[#sql_schema{
version = 1,
tables =