Adding a new column is one of the most common changes in a database. It sounds simple, but the consequences can ripple through every query, every API, and every dashboard that touches the schema. Choose the wrong type, name, or default value, and you can create technical debt in seconds.
When you add a new column, start with intent. Ask: What problem will this column solve? Is the data static or dynamic? Will it require indexing for performance? Write these answers down before you open the migration file.
In SQL, you use ALTER TABLE. Keep it precise:
ALTER TABLE orders
ADD COLUMN shipped_at TIMESTAMP DEFAULT NULL;
This lives in production forever unless you remove it. Test migrations in staging. Check that the new column integrates cleanly with ORM models, data pipelines, and client-side code.
For large datasets, adding a new column can lock the table. Plan maintenance windows or use tools that perform online schema changes. Monitor replication lag, because bulk operations can slow down secondaries.