The migration ran clean until the schema diff flagged a missing field. You need a new column. Fast.
Adding a new column sounds simple, but in production it can be dangerous. It can lock tables, spike CPU, and block reads or writes. The right approach depends on your database engine, your table size, and your uptime requirements.
First, define the column. Use the smallest data type possible—int over bigint, varchar(100) over text. Smaller types keep indexes lean and improve cache efficiency. Decide on NULL or NOT NULL up front. Adding a NOT NULL column without a default will backfill every row, triggering large writes. Use defaults carefully and consider staged rollouts.
Second, run the change in a safe window—or avoid blocking entirely. In PostgreSQL, adding a nullable column without a default is usually instant. Adding a default can be expensive on large tables, so instead, add the column as nullable, then update rows in small batches. In MySQL with InnoDB, adding a column can rebuild the table. Use ALTER TABLE ... ALGORITHM=INPLACE or online schema change tools to avoid downtime.