24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-16 22:05:29 +02:00

ejabberd_sql_schema: Rewrite recent commit cb49fcf

lists:search is available since OTP 21.0, and ejabberd is said to
support since OTP 20.0.
Also, that code wouldn't work if ejabberd uses different database types
(MySQL, PgSQL, ...), as this would only update the first database.
This commit is contained in:
Badlop 2024-01-09 13:27:28 +01:00
parent 034af6aefd
commit 599cddfb67

View File

@ -773,14 +773,10 @@ should_update_schema(Host) ->
case ejabberd_sql:use_new_schema() of
true ->
%% TODO: not efficient when there are many hosts
case lists:search(
fun(H) ->
lists:member(
sql, ejabberd_option:auth_method(H))
end, ejabberd_option:hosts()) of
{value, Host} ->
case lists:member(sql, ejabberd_option:auth_method(Host)) of
true ->
true;
_ ->
false ->
false
end;
false ->