OneLinersCommand workbench
AI
Back to prompts
plain-prompt

Plan a safe SQL schema migration

Sequence compatibility, backfill, validation, cutover, and rollback for production.

Revision
1
Verified
2026-07-26
Save or explore
Save to collectionCreate a collection in the sidebar first.

Compatibility and paths

GenericWorks with instruction-following chat models.
ChatGPT
Claude Code
Gemini CLI

Trust and provenance

Curated record reviewed 2026-07-26. Results still depend on the supplied context and target environment.

Fill variables

Values stay in this browser tab and are not stored.

Generated asset2 required field(s) must be completed
Objective: Produce an expand-and-contract migration with measurable gates.

Context: Avoid long blocking operations and irreversible cutovers without backups.

Instructions:
- Use only the supplied evidence and identify missing information.
- Lead with the finding, confidence, and one safe next action.
- Put read-only checks before mutations and include a stop condition.
- Never request or reproduce secrets, credentials, or private keys.

User request:
Database/version/workload:
{{environment}}

Desired schema change:
{{evidence}}

Plan the migration.

Required output:
- Finding
- Evidence
- Confidence
- Safe next check
- Stop condition

Real example

Input

PostgreSQL 16; rename users.name to display_name; old and new app versions overlap for 30 minutes

Expected result

Expand: add nullable display_name. Dual-write and backfill in bounded batches. Validate counts/checksums. Cut readers, then writers. Contract old column only after rollback window closes.

Source evidence

PostgreSQL documentationofficial