fix(migration): make migration idempotent and auto-resolve failed state on deploy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 12:02:21 +08:00
parent 1916c616de
commit f0504c9dc0
2 changed files with 69 additions and 23 deletions

View File

@@ -3,6 +3,10 @@ set -e
echo "🔄 Running database migrations..."
cd /app
# Resolve any previously failed migrations before re-applying
bunx prisma migrate resolve --rolled-back 20260423072135_add_stok_to_pasar_desa 2>/dev/null || true
bunx prisma migrate deploy || {
echo "❌ Migration failed!"
exit 1