It looked simple in the diff. One line in the schema file. One extra field in the table. But the real work started after the deploy. Adding a new column is not just about altering a table. It can affect queries, indexes, data integrity, and application logic.
When you add a new column in SQL, consider its default value. Null defaults can cause implicit behavior in queries. Non-null defaults can lock the table during write operations on large datasets. For high-traffic systems, use a phased migration: first add the column as nullable, backfill in batches, then enforce constraints.
Indexes are another factor. Avoid creating new indexes at the same time as the column addition if uptime matters. Create the column, load the data, and then build indexes to reduce lock time.
Alterations can break ORM mappings. Ensure your model definitions track the new field. In GraphQL or REST APIs, ensure that the schema changes are backward compatible. Clients expecting older payloads must not crash when the new column appears.