Alter Mnesia Table

Sean Hinde sean.hinde@REDACTED
Tue Sep 2 00:09:07 CEST 2003

On Monday, September 1, 2003, at 10:24  pm, Jilani Khaldi wrote:

> Hi,
> I have craeted a Mnesia database with a single table:
> -record(persons, {code, f_name, l_name, address, home_page}).
> and I have put in some records.
> Now, I want to add  the field "e_mail ", in position 3 (just after 
> l_name) and change "f_name" with "first_name" and delete the field 
> "home_page".
> I use alter table to make all these changes with an SQL RDBMD, but how 
> to do it with Mnesia?

Read up about mnesia:transform_table - all will be revealed. If your 
table is so large that this proves impossible within the memory 
constraints of your machine or the emulator, you can also take a backup 
and transform the backup using mnesia:traverse_backup

> An other question: does Mnesia support referential integrity?

Only by allowing access in a controlled manner using your own carefully 
crafted transactions. There is no built in way to enforce relationships 
between different tables (I assume this is the sort of thing you meant).


More information about the erlang-questions mailing list