mirror of
https://github.com/StefBuwalda/WebTech.git
synced 2025-10-30 11:19:58 +00:00
14 lines
329 B
Bash
14 lines
329 B
Bash
#!/bin/bash
|
|
# Wait for DB to be ready (optional step)
|
|
# ./wait-for-it.sh db:5432 --timeout=30 -- echo "DB is up"
|
|
|
|
# Only run flask db init if migrations folder doesn't exist
|
|
if [ -d "migrations" ] && [ -z "$(ls -A migrations)" ]; then
|
|
flask db init
|
|
fi
|
|
|
|
flask db migrate -m "Autogenerated migration"
|
|
flask db upgrade
|
|
|
|
exec "$@"
|