migration shouldnt fail if there is no site yet

This commit is contained in:
Mate Majoros 2026-01-08 14:53:24 +02:00
parent c39e86d319
commit 23e5b0ce27

View file

@ -10,15 +10,13 @@ SITES=$(docker compose exec -T backend ls -1 /home/frappe/frappe-bench/sites | g
if [ -z "$SITES" ]; then if [ -z "$SITES" ]; then
echo "❌ No sites found!" echo "❌ No sites found!"
exit 1 else
fi echo "📋 Found sites:"
echo "$SITES"
echo ""
echo "📋 Found sites:" # Run migrate for each site
echo "$SITES" for site in $SITES; do
echo ""
# Run migrate for each site
for site in $SITES; do
echo "🔧 Migrating site: $site" echo "🔧 Migrating site: $site"
# Run bench migrate # Run bench migrate
@ -34,14 +32,15 @@ for site in $SITES; do
echo "✅ Migration completed for site: $site" echo "✅ Migration completed for site: $site"
echo "" echo ""
done done
echo "🎉 All migrations completed successfully!" echo "🎉 All migrations completed successfully!"
# Optional: Run bench doctor to check system health # Optional: Run bench doctor to check system health
echo "🏥 Running system health check..." echo "🏥 Running system health check..."
docker compose exec -T backend bench doctor || { docker compose exec -T backend bench doctor || {
echo "⚠️ Warning: Some health checks failed" echo "⚠️ Warning: Some health checks failed"
} }
echo "✨ Migration process finished!" echo "✨ Migration process finished!"
fi