The schema was brittle. One more field, and the system would crack. You needed a new column.
Adding a new column in a production database isn’t a side task. It’s a change that touches code, data, performance, and uptime. Done wrong, it slows queries or locks tables. Done right, it extends the model without breaking existing behavior.
Start with the definition. A new column in SQL is created using ALTER TABLE with the appropriate data type, constraints, and default values. Without defaults, historical rows can become null-filled hazards. Index only if necessary; extra indexes cost more than they save during write-heavy loads.
Plan the deployment. If you run migrations in a continuous delivery pipeline, break the change into safe steps. First, add the column without altering existing queries. Then update the application to write to it. Finally, backfill data in controlled batches to avoid blocking transactions.