The database waited. You needed a new column, but every step could break something if you moved too fast.
Adding a new column is a common migration. It sounds simple. It is not. When your schema changes, every query, index, and API call can be affected. The key is to add it without downtime, without corrupting data, and without slowing the application.
First, know your constraints. Identify the table’s size, locking behavior, and the impact on reads and writes. On large tables, adding a column with a default value can lock the table for minutes or hours. This can take your app offline.
Second, choose the right migration approach. Many teams use ALTER TABLE directly in production. This runs fast on small tables. On big tables, use an online schema change tool like pt-online-schema-change or gh-ost. These copy data in chunks and keep the application running.