@@ -0,0 +1,30 @@
1+#!/usr/bin/env bash
2+set -euo pipefail
3+
4+echo "⚠️ WARNING: This will delete the PostgreSQL container and ALL database data!"
5+
6+# Stop and delete PostgreSQL container if it exists
7+if docker ps -a --format '{{.Names}}' | grep -q '^postgres$'; then
8+ echo "Stopping PostgreSQL container..."
9+ docker stop postgres 2>/dev/null || true
10+ echo "PostgreSQL container stopped."
11+
12+ echo "Removing PostgreSQL container..."
13+ docker rm postgres 2>/dev/null || true
14+ echo "PostgreSQL container removed."
15+else
16+ echo "PostgreSQL container not found."
17+fi
18+
19+# Remove the volume to completely wipe all data
20+if docker volume ls --format '{{.Name}}' | grep -q '^postgres_data$'; then
21+ echo "Removing postgres_data volume..."
22+ docker volume rm postgres_data
23+ echo "✓ Volume removed. All database data has been wiped."
24+else
25+ echo "postgres_data volume not found."
26+fi
27+
28+echo ""
29+echo "✅ PostgreSQL container and all data removed successfully!"
30+