The database waits. You have the schema in front of you, the production branch pulled, and the task is simple on paper: add a new column.
Adding a new column is not just altering a table. It is altering contracts, workflows, and possibly the performance profile of your system. In most cases, you will execute an ALTER TABLE statement. In MySQL, Postgres, or SQL Server, the syntax looks similar, but the behavior can vary. Postgres can add a nullable column instantly, while MySQL may lock the table depending on the storage engine and version.
When you add a new column, decide first on nullability and default values. A NOT NULL column with no default will fail if rows exist. Adding a default can trigger a rewrite of the table and cause downtime for large datasets. Nullable columns avoid this but can push complexity into the application layer where null handling must be explicit.
Indexing the new column can help with future query performance but adds write overhead. Consider whether to create the index immediately or after backfilling data. For high-traffic systems, adding both a column and its index in the same migration can extend locks and slow response times.
Backfilling is a common second step. Use batched updates to avoid locking the table for too long. Monitor replication lag during the process if you have read replicas. Even a single new column can affect replication speed and query plans.