A single schema change can break a deployment. You push code, run migrations, and realize the table needs a new column. Now the clock is ticking.
Adding a new column is simple in theory but dangerous in active production systems. The way you add it determines uptime, query performance, and deployment safety. You cannot just alter a table blindly if it holds millions of rows or sits under high traffic.
First, plan the schema update. Identify the table, column name, data type, nullability, and default values. Decide whether the new column should be nullable or have a default to avoid blocking inserts. Without these details, your migration can stall writes and cause timeouts.
Second, choose the safest method for your database engine. In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable or default-null fields. Setting a non-null default forces a table rewrite, which can lock writes. In MySQL, older versions handle this even slower, making it critical to chunk or stage changes.