mirror of
https://github.com/StefBuwalda/WebTech.git
synced 2025-11-01 12:19:58 +00:00
20 lines
516 B
Bash
20 lines
516 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
|
|
echo "Initializing migrations..."
|
|
flask db init
|
|
|
|
# Generate migration scripts if there are changes
|
|
echo "Running flask db migrate..."
|
|
flask db migrate -m "Autogenerated migration"
|
|
|
|
# Apply the migrations to the database
|
|
echo "Running flask db upgrade..."
|
|
flask db upgrade
|
|
|
|
# Start Flask application
|
|
echo "Starting Flask app..."
|
|
python app.py
|