For example, I saved {id, name}
in mnesia and want to update to {id, name, age}
, do I have to call transform_table
every time I change schema?
What's the simplest way to update mnesia schema?
The simplest way is to delete the table and recreate it. If you need to keep the data in the table, mnesia:transform_table
is the way to go.
Don't you think deleting and recreating the tables might break the production system. –
Steno
In most cases, yes, unless you make it not access the database while you're recreating the tables.
transform_table
avoids such problems. –
Flare Yep, transform_table is the decent approach to tackle such problem. I was just giving a wider perspective to the answer. –
Steno
© 2022 - 2024 — McMap. All rights reserved.
options::proplists()
column to each table :) – Delbert