mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Add support to delete content and delete table.
SVN Revision: 2388
This commit is contained in:
parent
b3eb800be1
commit
140d938bc3
@ -2196,7 +2196,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;
|
||||
@ -2211,11 +2213,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