watcher-ts/scripts/reset-dbs.sh
Ashwin Phatak 4f8f1d8cd7
Update code for log_cids change in vdb core (#243)
* Remove fields no longer present in schema.

* Refactor code to work with log_cids change in eth-server.

* Refactor process event to save events from logs.

* Use constants for erc20 event names.

* Implement watch blocks in erc20-watcher similar to uni-watcher.

* Moved common methods to util.

* Implement eventsInRange query in erc20-watcher.

* Filter unknown event in database query.

* Change dependencies version to be same in all packages.

Co-authored-by: nabarun <nabarun@deepstacksoft.com>
2021-09-21 16:43:55 +05:30

28 lines
720 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
dropdb uni-watcher
dropdb uni-info-watcher
createdb erc20-watcher
createdb address-watcher
createdb uni-watcher
createdb uni-info-watcher
psql -d erc20-watcher-job-queue -c "delete from pgboss.job;"
psql -d address-watcher-job-queue -c "delete from pgboss.job;"
psql -d uni-watcher-job-queue -c "delete from pgboss.job;"
psql -d uni-info-watcher-job-queue -c "delete from pgboss.job;"
EOF
else
echo "Abort."
fi