Generate Database Migration and Rollback Specs for Coding Agents
Get a structured migration and rollback plan that ensures data integrity and zero-downtime execution for your database schema changes.
Agent prompt for Claude Code and Cursor
Prompt
mkdir -p .agents/skills/generate-database-migration-and-rollback-specs-for-coding-agents && curl -sL "https://prompts-gpt.com/prompts/generate-database-migration-and-rollback-specs-for-coding-agents/raw" -o .agents/skills/generate-database-migration-and-rollback-specs-for-coding-agents/SKILL.md---
name: generate-database-migration-and-rollback-specs-for-coding-agents
description: "Get a structured migration and rollback plan that ensures data integrity and zero-downtime execution for your database schema changes."
---
# Generate Database Migration and Rollback Specs for Coding Agents
Get a structured migration and rollback plan that ensures data integrity and zero-downtime execution for your database schema changes.
## Prompt
```
Act as a Senior Database Reliability Engineer. I will provide a schema change request. Your job is to generate a migration brief that ensures safety and atomicity. Follow these rules: 1. Always provide an explicit rollback script that reverses the change without data loss. 2. Include a LOCK_TIMEOUT setting for every DDL operation to prevent blocking production queues. 3. For adding columns, ensure the use of NULL or DEFAULT values that avoid full table locks on large datasets. 4. Define a specific verification test case for both the forward and rollback operations. Output format: ### Migration Details: [Title and target table] ### SQL Migration: [Code block] ### Rollback Script: [Code block] ### Safety Checklist: [List of locks and timeout settings] ### Verification Protocol: [Step-by-step validation steps]. This is technical guidance; verify all migrations in a staging environment before production. Ask me for the schema change details and current table size now.
```
## Usage Notes
Use this prompt when you need to update production databases safely. Paste this into ChatGPT, Claude, or Cursor, then follow the agent's prompts to provide your SQL requirements and table context.
Act as a Senior Database Reliability Engineer. I will provide a schema change request. Your job is to generate a migration brief that ensures safety and atomicity. Follow these rules: 1. Always provide an explicit rollback script that reverses the change without data loss. 2. Include a LOCK_TIMEOUT setting for every DDL operation to prevent blocking production queues. 3. For adding columns, ensure the use of NULL or DEFAULT values that avoid full table locks on large datasets. 4. Define a specific verification test case for both the forward and rollback operations. Output format: ### Migration Details: [Title and target table] ### SQL Migration: [Code block] ### Rollback Script: [Code block] ### Safety Checklist: [List of locks and timeout settings] ### Verification Protocol: [Step-by-step validation steps]. This is technical guidance; verify all migrations in a staging environment before production. Ask me for the schema change details and current table size now.Example output
Tips and common edits
Why this works
- Forces explicit inclusion of rollback scripts to ensure reversibility.
- Mandates lock timeouts to prevent production database outages.
- Requires specific validation steps to confirm migration success.
Use this prompt when you need to update production databases safely. Paste this into ChatGPT, Claude, or Cursor, then follow the agent's prompts to provide your SQL requirements and table context.
Common edits
- Adjust the lock_timeout duration based on your specific database driver.
- Add specific constraints like CHECK or UNIQUE if your migration requires them.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Create Automated Verification Loops for Long-Running Coding Agents
Generate a deterministic shell pipeline that combines linting, isolated unit testing, and diff-budget monitoring to validate AI agent code changes.
Design a Sandbox Security Policy for Autonomous Coding Agents
Generate a rigorous security policy for autonomous agents to define allowed shell commands, file access boundaries, and network restrictions.
Audit PR Git Diffs for Scope Creep and Churn
Reviews git diff statistics and patch files to immediately flag out-of-scope edits, accidental whitespace formatting churn, and unrequested dependency updates.
Convert User Stories into Strict Acceptance Test Assertions
This prompt transforms vague business requirements into precise Given-When-Then test assertions with exact HTTP status codes and JSON payload structures for AI coding agents.
Generate Reproducible Bug Fix Specs for Coding Agents
Get a standalone reproduction test script and a precise technical plan to fix a bug, ensuring your AI agent stays focused and avoids unnecessary file changes.
Create a Legacy Module Reference Sheet for Coding Agents
Compresses messy legacy source files into a dense markdown cheat sheet capturing public methods, hidden state changes, and side effects for coding agent contexts.
- Create a Verification Loop Script for AI Coding Agents
- Evaluate Coding Agent Test Suites for False Positive Traps
- Review AI Pull Requests for Phantom Imports and Bloat
- Structure a Multi-Repo Dependency Update Brief for Coding Agents
- Turn Bug Reports into Agent Reproduction Scripts and Fix Briefs
- Verify the Coding Agent's 'Done' Claim Against the Diff and Test Output