Erlang/OTP Forums

Author Message

<  Erlang Web mailing list  ~  [Erlangweb-users] Mnesia schema change, tutorial adding fiel

Guest
Posted: Sat Dec 05, 2009 4:47 pm Reply with quote
Guest
Hi,

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

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?

How to just add modifications to an existing mnesia db?

Thanks in advance.




------------------------------------------------------------------------------
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
Erlangweb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlangweb-users
http://www.erlang-web.org/
Post received from mailinglist
Guest
Posted: Mon Dec 07, 2009 8:24 am Reply with quote
Guest
Hi,

----- fruity@freaknet.org 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
Erlangweb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlangweb-users
http://www.erlang-web.org/
Post received from mailinglist
wuji
Posted: Sat Aug 25, 2012 6:45 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
we don't know a lot of the circumstances, even around around cheap designer *beep* around his personal life. This was not someone anyone followed.
is someone that sadly a lot of people had forgotten forgotten cheap Christian Louboutin forgotten about," said Ian Drew, senior editor at Us Weekly.Sage
is the eldest of Sylvester Stallone's five children with first first [h4]red bottom shoes[/h4] first wife Sasha Czack. US Navy Fires on Ship in
Gulf, One DeadUS Official Says Warning Shots Fired Before Small Small [h1]red bottom shoes[/h1] Small Vessel Was 'Engaged'By LUIS MARTINEZJuly 16, 2012 — An
Navy ship fired on a boat in the Persian Gulf Gulf [h2]cheap Ralph Lauren Polo[/h2] Gulf today, killing one person and injuring three others aboard
craft, U.S. naval officials told ABC News.Lt. Greg Raelson, a a [h2]cheap Ralph Lauren Polo[/h2] a spokesperson for the Navy's 5th Fleet, which is based
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum