The schema is brittle. The migration hits production in five minutes. You need a new column, and you need it without breaking anything.
Adding a new column is simple in theory. In practice, it can stall delivery, create downtime, or trigger errors if not done right. The database will lock, queries will block, and services may fail. The right approach reduces risk and keeps deployments smooth.
First, define the new column in your migration script. Choose a name that matches your data model and future use. Decide on type, nullability, and default values. Avoid adding a non-null column without a default to a large table—it will rewrite every row and can block live traffic.
Use an online schema change tool if your database supports it. MySQL has pt-online-schema-change and gh-ost. PostgreSQL can add nullable columns instantly, but defaults must be handled in a separate step to keep it fast. Split the deployment: add the nullable column first, backfill in batches, then enforce constraints later.