Database: Zero-Downtime Schema Migration
You must rename a column that's written by an old code path while new code needs the new name. Plan the rollout without downtime.
Technical Reference & Key Concepts
The Challenge: Renaming a Column Without Downtime
The users table has status with values 'active'/'disabled'. Product wants state with values 'active'/'suspended'/'deleted'. Old code writes status; new code will write state. Millions of users, must stay online.
Core questions to address:
- Why can't you just ALTER TABLE rename + deploy code in one step?
- What phased sequence would you run, and what is safe at each step?
- How do you keep the two columns consistent during the transition?