PageRenderTime 14ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/ucengine/src/backends/db/mnesia/mnesia_db.erl

http://github.com/AF83/ucengine
Erlang | 40 lines | 17 code | 6 blank | 17 comment | 0 complexity | 565494e645b17b6c1a4c1d01b39aa007 MD5 | raw file
  1. %%
  2. %% U.C.Engine - Unified Collaboration Engine
  3. %% Copyright (C) 2011 af83
  4. %%
  5. %% This program is free software: you can redistribute it and/or modify
  6. %% it under the terms of the GNU Affero General Public License as published by
  7. %% the Free Software Foundation, either version 3 of the License, or
  8. %% (at your option) any later version.
  9. %%
  10. %% This program is distributed in the hope that it will be useful,
  11. %% but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. %% GNU Affero General Public License for more details.
  14. %%
  15. %% You should have received a copy of the GNU Affero General Public License
  16. %% along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %%
  18. -module(mnesia_db).
  19. -export([init/2,
  20. drop/0,
  21. terminate/0]).
  22. -include("uce.hrl").
  23. call_mnesia_modules(Fun) ->
  24. lists:foreach(fun(Module) ->
  25. (list_to_atom(lists:concat([Module, "_mnesia"]))):Fun()
  26. end,
  27. [uce_role, uce_user, uce_meeting, uce_file, uce_event]).
  28. init(_Domain, undefined) ->
  29. call_mnesia_modules(init).
  30. drop() ->
  31. call_mnesia_modules(drop),
  32. ok.
  33. terminate() ->
  34. ok.