Ролевая модель и аудит Часть 1.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
|
||||
|
||||
-define(TABLES, [
|
||||
user, session, calendar, calendar_share, event, recurrence_exception,
|
||||
user, session, admin, admin_session, calendar, calendar_share, event, recurrence_exception,
|
||||
booking, review, report, banned_word, ticket, subscription, audit_log
|
||||
]).
|
||||
|
||||
@@ -62,7 +62,7 @@ create_table(Table) ->
|
||||
{atomic, ok} ->
|
||||
ok;
|
||||
{aborted, {already_exists, _}} ->
|
||||
ok;
|
||||
ok; % таблица уже существует – пропускаем
|
||||
{aborted, Reason} ->
|
||||
error({table_creation_failed, Table, Reason})
|
||||
end.
|
||||
@@ -78,6 +78,16 @@ table_opts(session) ->
|
||||
{attributes, record_info(fields, session)},
|
||||
{ram_copies, [node()]}
|
||||
];
|
||||
table_opts(admin) ->
|
||||
[
|
||||
{attributes, record_info(fields, admin)},
|
||||
{ram_copies, [node()]}
|
||||
];
|
||||
table_opts(admin_session) ->
|
||||
[
|
||||
{attributes, record_info(fields, admin_session)},
|
||||
{ram_copies, [node()]}
|
||||
];
|
||||
table_opts(calendar) ->
|
||||
[
|
||||
{attributes, record_info(fields, calendar)},
|
||||
|
||||
Reference in New Issue
Block a user