diff options
author | Erik Johnston <erik@matrix.org> | 2015-01-23 15:51:48 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-01-23 15:51:48 +0000 |
commit | 9b1e552b5163aad84a3ae4fd70116d3e782fb443 (patch) | |
tree | 19d827838d10688da26e3fa5503c63b71fd34db0 /scripts/nuke-room-from-db.sh | |
parent | Add storage method have_events (diff) | |
parent | Update .gitignore (diff) | |
download | synapse-9b1e552b5163aad84a3ae4fd70116d3e782fb443.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into rejections
Diffstat (limited to 'scripts/nuke-room-from-db.sh')
-rwxr-xr-x | scripts/nuke-room-from-db.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/nuke-room-from-db.sh b/scripts/nuke-room-from-db.sh new file mode 100755 index 0000000000..58c036c896 --- /dev/null +++ b/scripts/nuke-room-from-db.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +## CAUTION: +## This script will remove (hopefully) all trace of the given room ID from +## your homeserver.db + +## Do not run it lightly. + +ROOMID="$1" + +sqlite3 homeserver.db <<EOF +DELETE FROM context_depth WHERE context = '$ROOMID'; +DELETE FROM current_state WHERE context = '$ROOMID'; +DELETE FROM feedback WHERE room_id = '$ROOMID'; +DELETE FROM messages WHERE room_id = '$ROOMID'; +DELETE FROM pdu_backward_extremities WHERE context = '$ROOMID'; +DELETE FROM pdu_edges WHERE context = '$ROOMID'; +DELETE FROM pdu_forward_extremities WHERE context = '$ROOMID'; +DELETE FROM pdus WHERE context = '$ROOMID'; +DELETE FROM room_data WHERE room_id = '$ROOMID'; +DELETE FROM room_memberships WHERE room_id = '$ROOMID'; +DELETE FROM rooms WHERE room_id = '$ROOMID'; +DELETE FROM state_pdus WHERE context = '$ROOMID'; +EOF |