Update entrypoint.sh

This commit is contained in:
2025-05-26 22:08:20 +02:00
parent fd356fbd1c
commit 0e03681d82

View File

@@ -22,12 +22,17 @@ until PGPASSWORD=$POSTGRES_PASSWORD psql -h db -U $POSTGRES_USER -d $POSTGRES_DB
done
echo "PostgreSQL is up - executing command"
# Remove existing migrations and create fresh ones
echo "Setting up fresh database migrations..."
rm -rf migrations
# Run migrations if they exist, otherwise initialize them
echo "Checking database migrations..."
if [ -d "migrations" ]; then
echo "Running existing migrations..."
flask db upgrade
else
echo "Initializing new migrations..."
flask db init
flask db migrate -m "Initial migration"
flask db upgrade
fi
# Create default site settings if they don't exist
echo "Creating default site settings..."