Adding a new column looks simple. In production, it is not. A poorly executed schema change can lock tables, stall writes, and trigger outages. Small teams feel the pain fast. Large systems magnify it.
The first step is clear: define the new column in your migration script. Choose a name that will never confuse. Use consistent data types. Match constraints to business rules. Every deviation becomes technical debt.
Next, plan for deployment. In SQL databases like PostgreSQL, MySQL, and MariaDB, adding a new column with a default value can rewrite the entire table. That means downtime. Avoid defaults when possible. Add the column, then update values in batches. The order matters.
For huge datasets, use tools built for online schema change. They copy data in chunks while keeping your tables live. Monitor performance during every step. Keep an exit path ready in case latency spikes.