summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-05-09 09:43:07 +0100
committerGitHub <noreply@github.com>2018-05-09 09:43:07 +0100
commitd5377eba5506934d8cc3f5eaa42393223faa6f0e (patch)
treee97f60cd73adf4bbacb27cdd6aa8b951f2ed185a
parentMerge pull request #3190 from mujx/notif-token-fix (diff)
parentnuke-room-from-db.sh: added postgresql option and help (diff)
downloadsynapse-d5377eba5506934d8cc3f5eaa42393223faa6f0e.tar.xz
Merge pull request #2337 from rubo77/patch-5
nuke-room-from-db.sh: added postgresql option and help
-rwxr-xr-xscripts-dev/nuke-room-from-db.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts-dev/nuke-room-from-db.sh b/scripts-dev/nuke-room-from-db.sh

index 1201d176c2..cd74d78d6a 100755 --- a/scripts-dev/nuke-room-from-db.sh +++ b/scripts-dev/nuke-room-from-db.sh
@@ -6,9 +6,19 @@ ## Do not run it lightly. +set -e + +if [ "$1" == "-h" ] || [ "$1" == "" ]; then + echo "Call with ROOM_ID as first option and then pipe it into the database. So for instance you might run" + echo " nuke-room-from-db.sh <room_id> | sqlite3 homeserver.db" + echo "or" + echo " nuke-room-from-db.sh <room_id> | psql --dbname=synapse" + exit +fi + ROOMID="$1" -sqlite3 homeserver.db <<EOF +cat <<EOF DELETE FROM event_forward_extremities WHERE room_id = '$ROOMID'; DELETE FROM event_backward_extremities WHERE room_id = '$ROOMID'; DELETE FROM event_edges WHERE room_id = '$ROOMID';