Now the other thing production has that your laptop doesn't: it can't stop. Everything you change, you change while it runs.
Migration
A script that changes the structure of a live database, such as adding a column, and is kept in your repo so that every copy can run it in order. The hard part is that, for a while, old code and new code are running against it at once.
An agent treats a migration as one edit next to another, and on a laptop it is. In production the deploy isn't instant, so the old code meets the new schema, or the new code meets the old one. A migration that looks like one tidy line can also lock a busy table while it runs. Neither shows up in tests.
“Before you write this migration, tell me what the old code does when this runs and what the new code does before it runs. Set lock_timeout to 2s. Use CREATE INDEX CONCURRENTLY. Don't rename or drop anything in this change.”