diff --git a/scripts/monitor-db-stability.sh b/scripts/monitor-db-stability.sh index e1cdc240..711b3a3b 100755 --- a/scripts/monitor-db-stability.sh +++ b/scripts/monitor-db-stability.sh @@ -66,6 +66,20 @@ if [ "$MICRODAO_COUNT" -lt 5 ] || [ "$AGENT_COUNT" -lt 10 ]; then # Remove test agents bash scripts/remove-test-agents.sh 2>&1 | tail -3 || true + # Restore asset URLs (logos and banners) + log "🖼️ Restoring asset URLs..." + docker exec daarion-postgres psql -U postgres -d daarion -c " + UPDATE microdaos + SET logo_url = 'https://assets.daarion.space/daarion-assets/microdao/logo/' || slug || '.png' + WHERE logo_url IS NOT NULL + AND (logo_url LIKE '/assets/%' OR logo_url NOT LIKE 'https://%'); + + UPDATE microdaos + SET banner_url = NULL + WHERE banner_url IS NOT NULL + AND (banner_url LIKE '/api/static/%' OR banner_url NOT LIKE 'https://%'); + " 2>&1 | grep -v "UPDATE\|^$" || true + log "✅ Recovery complete" else log "❌ No backup found for recovery"