Database migration
A saved script that changes your database's structure, like adding a column, so every copy of the database gets the same change.
What it is
A database migration is a saved script that changes the structure of your database: adding a column, creating a table, renaming a field. It is stored with your code, so the same change can run on a test copy first and then on the live database.
You need one any time a feature needs somewhere new to put data. Your agent writes it, and good tools show it to you before running it. Two things to check: does it keep the rows you already have, and does it touch anything you didn't ask for?
A migration changes structure, not content. Adding sample records is seed data. People also say "migrating" for moving a whole app to a new host, which is a different job.
How to ask for it
“I want to add a phone number to customers but I don't want to lose the ones I already have.”
“Add an optional phone field to the customers table as a database migration. Show me the migration before running it, run it on staging first, and leave all existing rows unchanged.”
"Add a phone number" could be done by rebuilding the table and losing data, while "database migration" means a reviewable, repeatable change and the prompt protects existing rows.
You've seen this in
- CLovable showing you the database change and asking for approval in the chat before it runs
- PThe supabase/migrations folder of saved change files that appears in a project
- DA "run migrations" step in the deploy of a Rails or Django app