The migration had to run before sunrise, and the schema wasn’t ready. A new column stood between you and production.
Adding a new column sounds simple. In reality, it is an operation that can carry performance risk, downtime, and broken queries if done wrong. Databases treat schema changes differently depending on the engine, size of data, and storage format. The goal is not just to create a column—it’s to do it without slowing or blocking live traffic.
When you add a new column in MySQL or PostgreSQL, understand the lock behavior. Some operations rewrite the entire table. Others allow instant addition if the column is nullable and has no default value. Always check the version-specific capabilities. Even minor releases can change how ALTER TABLE behaves.
For large datasets, plan an online migration. This may involve tools like pt-online-schema-change or native online DDL features. These techniques avoid locking the table for the full migration time. Split the work into smaller batches when the volume is high. Monitor replication lag if you run read replicas.