Back to prompts
Write a database migration script for the following schema change. Database: [POSTGRESQL / MYSQL / SQLITE / etc.] Migration tool: [PRISMA / FLYWAY / LIQUIBASE / KNEX / CUSTOM] Change needed: [DESCRIBE WHAT NEEDS TO CHANGE — e.g. add a column, rename a table, change a data type, add an index, backfill data, split a table] Requirements: 1. The UP migration — applying the change 2. The DOWN migration — rolling back safely 3. Any data migration steps (if existing data needs transforming) 4. Index considerations — what indexes to add/remove 5. Locking considerations — will this migration lock the table in production? 6. Estimated downtime (or how to make it zero-downtime) 7. How to verify the migration succeeded Include comments explaining any non-obvious steps.
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.