The migration froze on line 37. The error: no such column. You know exactly what it means—you need a new column, and you need it now.
Adding a new column in a production database is simple in syntax but dangerous in execution. The wrong move locks tables, blocks queries, or corrupts data. The right move creates the column seamlessly, with zero downtime.
A new column changes the shape of your schema. Whether you are adding a timestamp, a UUID, a JSONB field, or an enum, the process demands precision. In PostgreSQL, use ALTER TABLE ... ADD COLUMN with care. Adding a column with a default value can rewrite an entire table; on large datasets, that is a performance killer. Instead, first add the column as NULL, then backfill data in small batches, and finally set the default if needed.
In MySQL and MariaDB, column order can change query performance due to row format. Avoid unnecessary reordering or wide VARCHAR fields unless you have proven need. For column types, pick the smallest type that fits your data—wider types increase memory and storage cost.