From 1703dc784d51fd77270078dc8f8f2373866342a5 Mon Sep 17 00:00:00 2001 From: csae8092 Date: Fri, 5 Nov 2021 11:38:24 +0100 Subject: [PATCH] migrate if env variable is set --- start-server.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/start-server.sh b/start-server.sh index 0a9d5c2..2480b01 100755 --- a/start-server.sh +++ b/start-server.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash # start-server.sh -echo "hallo" +echo "Hallo von Nabucco" +if [ -n "$MIGRATE" ] ; then + (echo "making migrations and running them" + python djangobaseproject/manage.py migrate --no-input) +fi if [ -n "$DJANGO_SUPERUSER_USERNAME" ] && [ -n "$DJANGO_SUPERUSER_PASSWORD" ] ; then (echo "creating superuser ${DJANGO_SUPERUSER_USERNAME}" && python djangobaseproject/manage.py createsuperuser --no-input --noinput --email 'blank@email.com') fi