watcher-ts/scripts/reset-dbs.sh
prathamesh0 80682e2755
Remove Uniswap watchers and related artifacts (#163)
* Remove Uniswap watchers and related code

* Remove Uniswap artifacts from graph-node

* Remove Uniswap artifacts from graph-test-watcher
2022-08-17 14:04:20 +05:30

22 lines
495 B
Bash
Executable File

#!/usr/bin/env bash
echo WARNING: This will reset all the databases used by the watchers.
read -p "Do you want to continue? (y/n)" choice
if [[ $choice =~ ^(Y|y| ) ]]
then
sudo -i -u postgres bash << EOF
export PGPASSWORD=postgres
dropdb erc20-watcher
dropdb address-watcher
createdb erc20-watcher
createdb address-watcher
psql -d erc20-watcher-job-queue -c "delete from pgboss.job;"
psql -d address-watcher-job-queue -c "delete from pgboss.job;"
EOF
else
echo "Abort."
fi