Move initdb into a management command

This commit is contained in:
Jim Fingal
2020-11-08 10:29:33 -08:00
parent e279ae0d88
commit 8c6c28c7d8
4 changed files with 111 additions and 95 deletions

13
fr-dev
View File

@ -12,7 +12,7 @@ case "$1" in
;;
initdb)
docker-compose exec web python manage.py migrate
docker-compose exec web python manage.py shell -c 'import init_db'
docker-compose exec web python manage.py initdb
;;
resetdb)
docker-compose stop web
@ -20,7 +20,7 @@ case "$1" in
docker-compose exec db createdb -U fedireads fedireads
docker-compose start web
docker-compose exec web python manage.py migrate
docker-compose exec web python manage.py shell -c 'import init_db'
docker-compose exec web python manage.py initdb
;;
makemigrations)
docker-compose exec web python manage.py makemigrations
@ -47,7 +47,14 @@ case "$1" in
collectstatic)
docker-compose exec web python manage.py collectstatic --no-input
;;
build)
docker-compose build
;;
clean)
docker-compose stop
docker-compose rm -f
;;
*)
echo "Unrecognised command. Try: up, initdb, resetdb, makemigrations, migrate, shell, dbshell, restart_celery, test, test_report"
echo "Unrecognised command. Try: build, clean, up, initdb, resetdb, makemigrations, migrate, shell, dbshell, restart_celery, test, test_report"
;;
esac