Added OpenAI large embedding / improve migration and upgrade handling for containers
This commit is contained in:
Binary file not shown.
@@ -1,33 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage: ./migrate.sh -m "Your migration message" -d migrations/public
|
||||
# Usage: ./db_migrate.sh -m "Your migration message" -d migrations/public
|
||||
|
||||
cd "/Volumes/OWC4M2_1/Dropbox/Josako's Dev/Josako/EveAI/Development/eveAI/" || exit 1
|
||||
source "/Volumes/OWC4M2_1/Dropbox/Josako's Dev/Josako/EveAI/Development/eveAI/.venv/bin/activate"
|
||||
# Load environment variables
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
|
||||
project_dir=$(pwd)
|
||||
# Ensure you're in the correct directory
|
||||
cd "$project_dir" || exit 1
|
||||
|
||||
# Load environment variables (including database connection details)
|
||||
source .env
|
||||
|
||||
# Set Flask app and Python path
|
||||
export FLASK_APP=scripts/run_eveai_app.py
|
||||
export PYTHONPATH="$PYTHONPATH:$project_dir"
|
||||
|
||||
while getopts m:d: flag
|
||||
do
|
||||
case "${flag}" in
|
||||
m) message=${OPTARG};;
|
||||
d) directory=${OPTARG};;
|
||||
*) # Catch-all for unexpected arguments
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
echo "Usage: ./migrate.sh -m \"Your migration message\" -d migrations/public"
|
||||
*)
|
||||
echo "Invalid option: ${flag}"
|
||||
exit 1
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if the message and directory are provided
|
||||
if [ -z "$message" ] || [ -z "$directory" ]; then
|
||||
echo "Both message and directory are required."
|
||||
echo "Usage: ./migrate.sh -m \"Your migration message\" -d migrations/public"
|
||||
echo "Usage: ./db_migrate.sh -m \"Your migration message\" -d migrations/public"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set FLASK_APP environment variable
|
||||
export FLASK_APP=scripts/run_eveai_app.py # Modify if your Flask app is initiated differently
|
||||
export PYTHONPATH="$PYTHONPATH:/Volumes/OWC4M2_1/Dropbox/Josako's Dev/Josako/EveAI/Development/eveAI/"
|
||||
|
||||
# Run the Flask migration command
|
||||
flask db migrate -m "$message" -d "$directory"
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage: ./upgrade.sh -d migrations/public
|
||||
|
||||
cd "/Volumes/OWC4M2_1/Dropbox/Josako's Dev/Josako/EveAI/Development/eveAI/" || exit 1
|
||||
source "/Volumes/OWC4M2_1/Dropbox/Josako's Dev/Josako/EveAI/Development/eveAI/.venv/bin/activate"
|
||||
|
||||
while getopts d: flag
|
||||
do
|
||||
case "${flag}" in
|
||||
d) directory=${OPTARG};;
|
||||
*) # Catch-all for unexpected arguments
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
echo "Usage: ./upgrade.sh -d migrations/public"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if the directory is provided
|
||||
if [ -z "$directory" ]; then
|
||||
echo "Directory parameter is required."
|
||||
echo "Usage: ./upgrade.sh -d migrations/public"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set FLASK_APP environment variable
|
||||
export FLASK_APP=scripts/run_eveai_app.py # Modify if your Flask app is initiated differently
|
||||
export PYTHONPATH="$PYTHONPATH:/Volumes/OWC4M2_1/Dropbox/Josako's Dev/Josako/EveAI/Development/eveAI/"
|
||||
|
||||
# Run the Flask upgrade command
|
||||
flask db upgrade -d "$directory"
|
||||
Reference in New Issue
Block a user