#!/bin/bash echo "=== RedFlag Database Recovery Script ===" echo echo "1. Stopping containers..." docker-compose down echo echo "2. Removing postgres volume to reset database (WARNING: This will delete all data)..." docker volume rm redflag_postgres-data 2>/dev/null echo echo "3. Starting containers with fixed configuration..." docker-compose up -d echo echo "4. Waiting for database to be ready..." sleep 10 docker exec redflag-postgres pg_isready -U redflag echo echo "5. Checking server logs (tail):" echo "==========================" docker logs redflag-server --tail 50 echo echo "==========================" echo "If migrations ran successfully, you should see:" echo "- Database migrations completed message" echo "- Default security settings initialized" echo "- Admin user ensured" echo echo "The server should now be accessible at http://localhost:8080" echo "Login with admin / Qu@ntum21!"