Adding a new column to a database table seems simple, but it can break production if done without planning. The schema change affects queries, indexes, and application logic. In high-traffic systems, even a single ALTER TABLE can lock rows, spike latency, and cascade into outages.
To add a new column safely, start by defining the data type and constraints with precision. Avoid default values that trigger full-table rewrites unless necessary. When possible, deploy in a two-step process: first, add the column as nullable; second, backfill data in small batches. This reduces lock contention and keeps the system responsive.
Check ORM models and API contracts. Any code that reads or writes to the table must be aware of the new column before the deployment. Schema drift between environments causes silent data loss. Run integration tests that hit real queries, not just mocks.