25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

Add support to delete content and delete table.

SVN Revision: 2390
This commit is contained in:
Badlop 2009-07-23 15:23:21 +00:00
parent 73f2fc76d9
commit 646adbf186

View File

@ -2233,7 +2233,9 @@ db_storage_select(ID, Opt, Lang) ->
end, [{ram_copies, "RAM copy"}, end, [{ram_copies, "RAM copy"},
{disc_copies, "RAM and disc copy"}, {disc_copies, "RAM and disc copy"},
{disc_only_copies, "Disc only 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,[]}]) -> node_db_parse_query(_Node, _Tables, [{nokey,[]}]) ->
nothing; nothing;
@ -2248,11 +2250,17 @@ node_db_parse_query(Node, Tables, Query) ->
"ram_copies" -> ram_copies; "ram_copies" -> ram_copies;
"disc_copies" -> disc_copies; "disc_copies" -> disc_copies;
"disc_only_copies" -> disc_only_copies; "disc_only_copies" -> disc_only_copies;
"delete_content" -> delete_content;
"delete_table" -> delete_table;
_ -> false _ -> false
end, end,
if if
Type == false -> Type == false ->
ok; ok;
Type == delete_content ->
mnesia:clear_table(Table);
Type == delete_table ->
mnesia:delete_table(Table);
Type == unknown -> Type == unknown ->
mnesia:del_table_copy(Table, Node); mnesia:del_table_copy(Table, Node);
true -> true ->