Created
December 26, 2016 08:42
-
-
Save yosukehara/081b664934f838339b62cc7fd506bd10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(mnesia_test). | |
-record(store, {key, value}). | |
-export([start/0, start/1, restart/0]). | |
start() -> | |
mnesia:create_schema([node()]), | |
mnesia:start(), | |
mnesia:create_table(store, [ | |
{disc_copies, [node()]}, | |
{attributes, record_info(fields, store)} | |
]). | |
start(Nodes) -> | |
mnesia:start(), | |
mnesia:change_config(extra_db_nodes, Nodes), | |
mnesia:change_table_copy_type(schema, node(), disc_copies), | |
mnesia:add_table_copy(store, node(), disc_copies). | |
restart() -> | |
mnesia:start(). |
Author
yosukehara
commented
Dec 26, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment