Adding a new column to a production database is a simple change that can break everything if done without care. Schema changes ripple through the application layer, APIs, and downstream jobs. To keep uptime and data integrity, you need a process that is both fast and safe.
A new column in SQL starts with an ALTER TABLE statement. In Postgres, for example:
ALTER TABLE orders ADD COLUMN delivery_eta TIMESTAMP WITH TIME ZONE;
This command blocks writes during execution in some configurations. On large tables, even a second of blocking can cause timeouts. Test the migration in a staging environment with realistic data volume. Measure execution time and watch the query plans.
When you create a new column with default values, be careful. Setting a default non-null value will backfill every row, which can lock the table for minutes or more. A safer pattern is: