%% —
%% Excerpted from “Programming Erlang, Second Edition”,
%% published by The Pragmatic Bookshelf.
%% Copyrights apply to this code. It may not be used to create training material,
%% courses, books, articles, and the like. Contact us if you are in doubt.
%% We make no guarantees that this code is fit for any purpose.
%% Visit http://www.pragmaticprogrammer.com/titles/jaerlang2 for more book information.
%%—
-module(test_mnesia2).
-import(lists, [foreach/2]).
-compile(export_all).
%% IMPORTANT: The next line must be included
%% if we want to call qlc:q(…)
-include_lib(“stdlib/include/qlc.hrl”).
-record(shop, {item, quantity, cost}).
-record(cost, {name, price}).
-record(design, {id, plan}).
do_this_once() ->
mnesia:create_schema([node()]),
mnesia:start(),
mnesia:create_ta