#!/usr/bin/env bash # Usage: ./db_heads.sh -d migrations/public cd "/app/" || exit 1 while getopts d: flag do case "${flag}" in d) directory=${OPTARG};; *) # Catch-all for unexpected arguments echo "Invalid option: -$OPTARG" >&2 echo "Usage: ./migrate.sh -m \"Your migration message\" -d migrations/public" exit 1 ;; esac done # Check if the message and directory are provided if [ -z "$directory" ]; then echo "Directory is required." echo "Usage: ./db_heads.sh -d migrations/public" exit 1 fi # Set FLASK_APP environment variable PROJECT_DIR="/app" export FLASK_APP=${PROJECT_DIR}/scripts/run_eveai_app.py # Adjust the path to your Flask app entry point export PYTHONPATH="$PYTHONPATH:$PROJECT_DIR" # Include the app directory in the Python path # Run the Flask migration command flask db heads -d "$directory"