mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +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
1 changed files with 3 additions and 7 deletions
|
@ -773,14 +773,10 @@ should_update_schema(Host) ->
|
||||||
case ejabberd_sql:use_new_schema() of
|
case ejabberd_sql:use_new_schema() of
|
||||||
true ->
|
true ->
|
||||||
%% TODO: not efficient when there are many hosts
|
%% TODO: not efficient when there are many hosts
|
||||||
case lists:search(
|
case lists:member(sql, ejabberd_option:auth_method(Host)) of
|
||||||
fun(H) ->
|
true ->
|
||||||
lists:member(
|
|
||||||
sql, ejabberd_option:auth_method(H))
|
|
||||||
end, ejabberd_option:hosts()) of
|
|
||||||
{value, Host} ->
|
|
||||||
true;
|
true;
|
||||||
_ ->
|
false ->
|
||||||
false
|
false
|
||||||
end;
|
end;
|
||||||
false ->
|
false ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue