fix table creation on a running cluster (#3913)

This commit is contained in:
Frank 2022-10-18 15:38:55 +02:00 committed by GitHub
parent d2f79e268e
commit 28b3134098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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.