Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the simplest way to update mnesia schema?

Tags:

erlang

mnesia

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?

like image 564
Comet Liao Avatar asked Apr 14 '13 10:04

Comet Liao


People also ask

How does Mnesia work?

In a system of Mnesia nodes, every node is aware of the current location of all tables. In this example, data is replicated on both nodes and functions that manipulate the data in the tables can be executed on either of the two nodes.

What is Mnesia in linux?

Mnesia is a distributed DataBase Management System (DBMS), appropriate for telecommunications applications and other Erlang applications which require continuous operation and exhibit soft real-time properties.

What is Mnesia table?

Mnesia is a distributed, soft real-time database management system written in the Erlang programming language. It is distributed as part of the Open Telecom Platform. Mnesia.


1 Answers

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.

like image 174
legoscia Avatar answered Oct 10 '22 06:10

legoscia