The migration failed. The log said “Unknown column.” You check the table. The column isn’t there. It never was.
Adding a new column should be simple. In practice, it’s where schema changes choke pipelines, stall deployments, and break production if done carelessly. Databases don’t forgive mistakes at scale. The right process prevents hours of downtime and rollback nightmares.
Define the new column in your migration script with clear data types, nullability rules, and defaults. For non-null columns, set a safe default before enforcing constraints. Deploy the change in isolation from application logic that depends on it. That ensures no read or write attempts hit a column that does not yet exist.
For large tables, adding a new column can lock rows. Use online DDL or partitioned updates to prevent blocking traffic. In PostgreSQL, ALTER TABLE ... ADD COLUMN with a DEFAULT and NOT NULL can rewrite the table; avoid this during peak hours. In MySQL, check ALGORITHM=INPLACE where possible. The goal is zero downtime and zero surprise rewrites.