Added OpenAI large embedding / improve migration and upgrade handling for containers

This commit is contained in:
Josako
2024-07-04 17:20:02 +02:00
parent 8e1dac0233
commit c55fc6b7ce
90 changed files with 1032 additions and 48 deletions

View File

@@ -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"