The migration ran clean until the database threw an error: column not found. You know the fix. Add a new column. Simple, but not trivial.
A new column changes the shape of your data. It alters queries, updates indexes, and touches the logic that reads and writes rows. In production, the cost of a mistake is downtime or corrupted records. The execution must be exact, whether it’s PostgreSQL, MySQL, or a cloud data warehouse.
Before adding a new column, define its type with intent. Avoid defaults unless they carry meaning. Enforce null constraints only when you can guarantee population. When possible, test the schema change in a staging environment with a realistic dataset. Measure impact on indexes, especially if your queries will filter or sort by the column.
In PostgreSQL, use ALTER TABLE ... ADD COLUMN with care. Backfilling large tables can lock writes. In MySQL, versions before 8.0 might cause a full table copy. For distributed systems like BigQuery or Snowflake, schema evolution is near-instant, but your application code may still need to handle absent or partially populated columns gracefully.