Hi,

----- [email protected] wrote:

> Hi,
> 
> in the shop tutorial from the erlang-web wiki when adding the field
> description are we changing the schema on the mnesia db?

Nope, we are only changing the model's constraints which is not
held in the database, it is just on the framework side. No schema
modifications are needed.

> When I run in interactive move db_init:init(). I get
> db_init module, mnesia's schema already exists, if you want to delete
> it, run mnesia:delete_schema/1
> do I also lose the data while deleting the schema?

Yes, deleting the schema causes also the data loss. 

> 
> How to just add modifications to an existing mnesia db?

If you would like to change the existing table (SQL-like ALTER TABLE)
you should use mnesia:transform_table/4 function
(http://www.erlang.org/doc/man/mnesia.html#transform_table-4).

> 
> Thanks in advance.
> 

Kind regards,
-- 
Michal Ptaszek
www.erlang-consulting.com

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Erlangweb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/erlangweb-users
http://www.erlang-web.org/

Reply via email to