Back to 🚢 DevOps & Deployment

Database Migration Rollback

DatabasePrismaEmergency
---
description: Revert the last database migration if something goes wrong
---

1. **Identify Migration**:
- Check migration status.
// turbo
- Run npx prisma migrate status

2. **Resolve Migration**:
- Mark a failed migration as resolved (if stuck).
// turbo
- Run npx prisma migrate resolve --rolled-back "migration_name"

3. **Down Migration (Manual)**:
- Prisma doesn't support auto-down. You must manually execute SQL to revert changes.
// turbo
- Run psql -d mydb -f ./migrations/down.sql

4. **Pro Tips**:
- Always test migrations on a copy of production data first.
By Antigravity Team

How to Use This Workflow

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/workflows/
  3. Save the file as rollback-prisma-database-migration-emergency.md
  4. In Antigravity, type /rollback_prisma_database_migration_emergency or just describe what you want to do

Learn more about workflows →

Related Workflows

Recommended Rules

View more rules →

Recommended MCP Servers

View more MCP servers →

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide