Adding a new column sounds simple, but in production systems it can destroy uptime if done carelessly. Schema changes impact indexes, queries, replication lag, and application compatibility. Treat them as surgical operations, not casual edits.
Before adding the new column, confirm the change in your migration planning. Check your ORM, raw SQL, and data models. Ensure backward compatibility so your code can run before, during, and after the schema update without breaking. If you serve live traffic, use a phased rollout:
- Add the new column with a default or allow nulls.
- Deploy code that writes to both the old and new columns.
- Backfill data in controlled batches.
- Switch reads to the new column after validation.
- Remove old columns only after full verification.
Indexes on the new column may be necessary for performance, but build them online when possible to avoid locking tables. Test query plans against real workloads before flipping reads.