Database Migration Script Generator

Generate safe database migration scripts with rollback support

6/11/2026
Prompt
Generate a database migration script for the following change:

Current Schema:
```sql
[PASTE CURRENT SCHEMA OR DESCRIBE IT]
```

Desired Change:
[DESCRIBE THE SCHEMA CHANGE NEEDED]

Database: [PostgreSQL/MySQL/SQL Server]
Migration Tool: [Prisma/Knex/TypeORM/Flyway/Raw SQL]
Data Preservation: [YES/NO - existing data considerations]

Please provide:
1. Up migration script
2. Down migration script (rollback)
3. Data migration steps if needed
4. Pre-migration validation checks
5. Post-migration verification queries
6. Estimated migration time and locking considerations

Or press ⌘C to copy

Variables (2)

Replace these placeholders with your own content before using the prompt.

[PASTE CURRENT SCHEMA OR DESCRIBE IT][DESCRIBE THE SCHEMA CHANGE NEEDED]

Ready to use?

Copy and paste into your favorite AI tool

Works With

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...