mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-30 16:36:29 +01:00
Add support to delete content and delete table.
SVN Revision: 2390
This commit is contained in:
parent
73f2fc76d9
commit
646adbf186
@ -2233,7 +2233,9 @@ db_storage_select(ID, Opt, Lang) ->
|
||||
end, [{ram_copies, "RAM copy"},
|
||||
{disc_copies, "RAM and disc copy"},
|
||||
{disc_only_copies, "Disc only copy"},
|
||||
{unknown, "Remote copy"}])).
|
||||
{unknown, "Remote copy"},
|
||||
{delete_content, "Delete content"},
|
||||
{delete_table, "Delete table"}])).
|
||||
|
||||
node_db_parse_query(_Node, _Tables, [{nokey,[]}]) ->
|
||||
nothing;
|
||||
@ -2248,11 +2250,17 @@ node_db_parse_query(Node, Tables, Query) ->
|
||||
"ram_copies" -> ram_copies;
|
||||
"disc_copies" -> disc_copies;
|
||||
"disc_only_copies" -> disc_only_copies;
|
||||
"delete_content" -> delete_content;
|
||||
"delete_table" -> delete_table;
|
||||
_ -> false
|
||||
end,
|
||||
if
|
||||
Type == false ->
|
||||
ok;
|
||||
Type == delete_content ->
|
||||
mnesia:clear_table(Table);
|
||||
Type == delete_table ->
|
||||
mnesia:delete_table(Table);
|
||||
Type == unknown ->
|
||||
mnesia:del_table_copy(Table, Node);
|
||||
true ->
|
||||
|
Loading…
Reference in New Issue
Block a user