Skip to content

Databases

Rename or remove a column without losing data

A simple rename can break the live app or wipe a column for good.

What you get
The change split into safe steps, each one deployable and reversible.
Paste it into
Your AI tool, in your project
The prompt
I want to make this database change: [describe it, for example rename a column or split a table].

Don't do it in one step. Plan it so the live app keeps working throughout: add the new structure, write to both old and new, copy existing data across, switch reads, and only then remove the old one in a later release.

For each step give me the migration, the code change that goes with it, how to check it worked, and how to undo it. Tell me which step is the point of no return and what backup to take before it. Estimate how long the copy will take on my data and whether it locks the table.

Use it

Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in. Replace the parts in [brackets] with your own details first.

More in Databases