Schema and code together.
THE PROBLEM
Code and schema change together, but do not deploy simultaneously.
WHAT THAT CAUSES
Code expecting a column that does not yet exist Or a removed column that code still uses
WHAT TO DO
Make changes in stages, each compatible with both versions.
HOW THAT WORKS FOR ADDING
Add the column Deploy code that writes to it Deploy code that reads from it
HOW THAT WORKS FOR REMOVING
Deploy code that stops using it Confirm nothing uses it Remove it in a later release
WHY THAT ORDER
At no point is the schema incompatible with running code.
WHAT TO NEVER DO IN ONE STEP
Rename a column.
Add, copy, switch, then remove.
WHAT TO BE CAREFUL WITH
Migrations locking large tables Migrations that also move data
WHAT TO DO ABOUT LARGE TABLES
Understand what the change locks, and for how long.
WHAT TO ALWAYS DO FIRST
Back up.
WHAT TO TEST
The migration on a copy with realistic volume.