From bc297d663d8d091ab253ea1736a9860fde8de7da Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 27 Aug 2022 19:53:57 +1000 Subject: [PATCH] fix resetdb Instead of just whining I thought maybe I should fix the problem. This replaces a manual reset of the database with deletion of the bookwyrm volumes using docker. fixes #2276 --- bw-dev | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bw-dev b/bw-dev index bffa358c9..a8f638803 100755 --- a/bw-dev +++ b/bw-dev @@ -84,16 +84,14 @@ case "$CMD" in ;; resetdb) prod_error - clean - # Start just the DB so no one else is using it - docker-compose up --build -d db - rundb dropdb -U ${POSTGRES_USER} ${POSTGRES_DB} - rundb createdb -U ${POSTGRES_USER} ${POSTGRES_DB} - # Now start up web so we can run the migrations - docker-compose up --build -d web + docker-compose rm -svf + docker volume rm -f bookwyrm_media_volume bookwyrm_pgdata bookwyrm_redis_activity_data bookwyrm_redis_broker_data bookwyrm_static_volume + docker-compose build migrate + migrate django_celery_beat initdb - clean + runweb python manage.py collectstatic --no-input + admin_code ;; makemigrations) prod_error