动态改变Mnesia表结构
-record(old, {key, val}).
-record(new, {key, val, extra}).
Transformer =
fun(X) ->
#new{key = X#old.key,
val = X#old.val,
extra = 42}
end,
{atomic, ok} = mnesia:transform_table(foo, Transformer,
record_info(fields, new)).