The schema was perfect until you realized it needed one more field. You stare at the table. The missing piece is obvious. The clock is ticking. You need a new column.
Adding a new column sounds simple, but it can break production if you get it wrong. It changes data structures, migration paths, and downstream systems. Queries must adapt. APIs need to handle it. Jobs reading from that table might fail if the change is pushed without care.
First, define the new column with precision. Name it exactly. Choose the right data type. Decide if it can be null. If not, set a default that makes sense across the dataset. Avoid vague types like TEXT unless the data truly demands it. For numbers, pick the smallest integer or decimal type that matches expected values.
Second, write a migration plan that works in both dev and prod. In SQL systems, use ALTER TABLE for small datasets. For large ones, consider adding the column without constraints, then backfilling in batches. Always ensure migrations are idempotent. If your ORM generates migrations, verify the SQL before it runs.