diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-05-09 09:43:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-09 09:43:07 +0100 |
commit | d5377eba5506934d8cc3f5eaa42393223faa6f0e (patch) | |
tree | e97f60cd73adf4bbacb27cdd6aa8b951f2ed185a /scripts-dev | |
parent | Merge pull request #3190 from mujx/notif-token-fix (diff) | |
parent | nuke-room-from-db.sh: added postgresql option and help (diff) | |
download | synapse-d5377eba5506934d8cc3f5eaa42393223faa6f0e.tar.xz |
Merge pull request #2337 from rubo77/patch-5
nuke-room-from-db.sh: added postgresql option and help
Diffstat (limited to 'scripts-dev')
-rwxr-xr-x | scripts-dev/nuke-room-from-db.sh | 12 |
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'; |