The migration failed because the schema was out of sync. You needed a new column, but you found yourself knee-deep in ALTER TABLE commands, locking tables at the worst possible time.
Adding a new column should be fast, safe, and predictable. In modern databases, the wrong approach can stall production or cause unwanted downtime. For large datasets, adding columns with default values or constraints can lock writes, degrade performance, or trigger full table copies. Understanding how your database engine handles schema changes is the difference between clean deployments and emergency rollbacks.
In PostgreSQL, adding a new column without a default is an instant metadata change. Adding one with a default in older versions rewrites the table. MySQL handles some ALTER COLUMN operations online, but others still block. SQLite rewrites the table entirely. These differences matter. Design migrations so they complete in seconds, not hours. Use online migration tools, break large changes into steps, and avoid combining destructive operations in a single migration.