always create mysql dbs if they do not exist w/ burnettk

This commit is contained in:
jasquat 2022-06-08 10:07:25 -04:00
parent 8e246e46b5
commit 6b7d3c4817
1 changed files with 3 additions and 2 deletions

View File

@ -18,12 +18,13 @@ if [[ "${1:-}" == "clean" ]]; then
rm -f ./src/spiffworkflow_backend/db*.sqlite3
mysql -uroot -e "DROP DATABASE IF EXISTS spiffworkflow_backend_development"
mysql -uroot -e "CREATE DATABASE spiffworkflow_backend_development"
mysql -uroot -e "DROP DATABASE IF EXISTS spiffworkflow_backend_testing"
mysql -uroot -e "CREATE DATABASE spiffworkflow_backend_testing"
fi
tasks="$tasks upgrade"
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS spiffworkflow_backend_development"
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS spiffworkflow_backend_testing"
for task in $tasks ; do
FLASK_ENV=development FLASK_APP=src/spiffworkflow_backend poetry run flask db "$task"
done