[erlang-questions] How to control a table version in Mnesia?

Shapovalov Taras shapovalovts@REDACTED
Tue Oct 14 10:12:33 CEST 2014


Thank you, Dmitry,

The disadvantage of user_properties in my case is it is not
auto-incremented by Mnesia upon table definition change (this feature would
be useful for me).

Best regards,

Taras

On Tue, Oct 14, 2014 at 11:10 AM, Dmitry Kolesnikov <dmkolesnikov@REDACTED>
wrote:

> Hello,
>
> You can use user_properties features of amnesia tables if you need some
> version for accounting.
>
> mnesia:create_table(myt, [{user_properties, [{vsn, 1}]}]).
> amnesia:table_info(myt, user_properties).
> [{vsn,1}]
>
>
> - Dmitry
>
> On 14 Oct 2014, at 09:33, Shapovalov Taras <shapovalovts@REDACTED> wrote:
>
> > Hi guys,
> >
> > Do you know if there is a safe way to increment a table version (in
> Mnesia schema) with some value (>1) or just set its value into a particular
> version? In my case Mnesia runs only in a local mode (and will never be
> distributed) and as far as I understand the version is not really used in
> the local mode, so I would like to utilize it for my purposes.
> >
> > By some reason mnesia_lib:set() does not really work for me. In fact
> after I call that function and then request the table version, it seems it
> is changed, but ets:tab2list(schema) shows that it did not (and after I
> restart Mnesia, the requested version returns to the old value).
> >
> > Best regards,
> >
> > Taras
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
/T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141014/8dcbad72/attachment.htm>


More information about the erlang-questions mailing list