The migration failed on the last step. A missing new column broke the build.
Adding a new column sounds trivial. It isn't. The wrong approach slows queries, locks tables, and risks downtime. The right approach takes seconds and keeps your data safe.
When you add a new column in SQL, the database must update the table definition. In small tables, this is instant. In large, heavily used tables, it can block reads and writes. On production, blocking means lost requests and rising error rates.
To do it right, first understand your database engine. MySQL, PostgreSQL, and others handle ALTER TABLE differently. MySQL may rewrite the table. PostgreSQL can add a nullable column fast, but adding a column with a default value may rewrite all rows.
Plan the schema change. Add the new column as nullable with no default. Backfill data in small batches to avoid locking. After the backfill completes, set the default, then update constraints. Each step reduces the chance of downtime.