A database change rolled out last night. Your query broke. The reason: you need a new column.
Adding a new column should be simple, but in production systems, nothing is simple. Schema changes are a contract update. Every downstream system must understand it. Every API that touches the table needs to adapt. Every migration must run clean, without blocking writes or forcing downtime.
The first step is deciding the column definition. Use the correct data type from the start—changing it later can be slow and risky. Define NOT NULL only if you can populate the column for every existing row during migration. If not, start with nullable, backfill, then tighten constraints.
Write the migration script idempotently. If it runs twice, it should not fail. This is critical for zero-downtime deploys across multiple environments. Apply changes in stages: