Skip to content

Commit

Permalink
Add ?MYNAME
Browse files Browse the repository at this point in the history
  • Loading branch information
vkatsuba committed Jul 22, 2020
1 parent 827a91f commit bfd8659
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/admin_extra/service_admin_extra_migration.erl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ migrate_pubsub_nodes([H|_]) ->
Cols = ["nidx", "p_key", "name", "type", "owners", "options"],
Vals = [H#pubsub_node.id, Host, ID, H#pubsub_node.type, Owners, Ops],
Q = ["INSERT INTO pubsub_nodes ", expand_sql_vals(Cols, Vals), ";"],
case mongoose_rdbms:sql_query(Host, Q) of
case mongoose_rdbms:sql_query(?MYNAME, Q) of
{error, Reason} ->
io:format("The SQL for 'pubsub_node' has error: ~p for values ~p~n", [Reason, Vals]);
_ ->
Expand Down Expand Up @@ -283,7 +283,7 @@ migrate_vcard([H|_]) ->
Cols = ["username", "server", "vcard"],
Vals = [Luser, Lserver, exml:to_binary(H#vcard.vcard)],
Q = ["INSERT INTO vcard ", expand_sql_vals(Cols, Vals), ";"],
case mongoose_rdbms:sql_query(Lserver, Q) of
case mongoose_rdbms:sql_query(?MYNAME, Q) of
{error, Reason} ->
io:format("The SQL for 'vcard' has error: ~p for values ~p~n", [Reason, Vals]);
_ ->
Expand Down Expand Up @@ -314,7 +314,7 @@ migrate_vcard_search([H|_]) ->
H#vcard_search.locality, H#vcard_search.llocality, H#vcard_search.email, H#vcard_search.lemail,
H#vcard_search.orgname, H#vcard_search.lorgname, H#vcard_search.orgunit, H#vcard_search.lorgunit],
Q = ["INSERT INTO vcard_search ", expand_sql_vals(Cols, Vals), ";"],
case mongoose_rdbms:sql_query(Lserver, Q) of
case mongoose_rdbms:sql_query(?MYNAME, Q) of
{error, Reason} ->
io:format("The SQL for 'vcard_search' has error: ~p for values ~p~n", [Reason, Vals]);
_ ->
Expand All @@ -339,11 +339,11 @@ migrate_users([H|_]) ->
P ->
mongoose_scram:serialize(P)
end,
{Luser, Lserver} = ejabberd_auth_internal:get_us(H),
{Luser, _} = ejabberd_auth_internal:get_us(H),
Cols = ["username", "password"],
Vals = [Luser, Password],
Q = ["INSERT INTO users ", expand_sql_vals(Cols, Vals), ";"],
case mongoose_rdbms:sql_query(Lserver, Q) of
case mongoose_rdbms:sql_query(?MYNAME, Q) of
{error, Reason} ->
io:format("The SQL for 'users' has error: ~p for values ~p~n", [Reason, Vals]);
_ ->
Expand Down

0 comments on commit bfd8659

Please sign in to comment.