summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank <5943122+fdie@users.noreply.github.com>2022-10-18 15:38:55 +0200
committerGitHub <noreply@github.com>2022-10-18 15:38:55 +0200
commit28b3134098934db456277c4be42a0075bd9d24a6 (patch)
tree56f4ae36f6b557dcb8617d050b66d04845c31114
parentUpdate Portuguese (Brazil) translation (thanks to Wellington Terumi Uemura) (diff)
fix table creation on a running cluster (#3913)
-rw-r--r--src/ejabberd_mnesia.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ejabberd_mnesia.erl b/src/ejabberd_mnesia.erl
index 70dfe3e6..88762746 100644
--- a/src/ejabberd_mnesia.erl
+++ b/src/ejabberd_mnesia.erl
@@ -172,7 +172,10 @@ change_table_copy_type(Name, TabDef) ->
if NewType /= CurrType ->
?INFO_MSG("Changing Mnesia table '~ts' from ~ts to ~ts",
[Name, CurrType, NewType]),
- mnesia_op(change_table_copy_type, [Name, node(), NewType]);
+ if CurrType == unknown -> mnesia_op(add_table_copy, [Name, node(), NewType]);
+ true ->
+ mnesia_op(change_table_copy_type, [Name, node(), NewType])
+ end;
true ->
{atomic, ok}
end.