fix: Restore asset URLs (logos/banners) after database recovery
- Update monitor-db-stability.sh to fix asset URLs after restore - Convert old /assets/ URLs to MinIO format - Clear invalid banner URLs
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user