mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-27 14:30:55 +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:
parent
034af6aefd
commit
599cddfb67
@ -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 ->
|
||||
|
Loading…
Reference in New Issue
Block a user