Adding a new column should be simple. Too often, it’s not. Schema changes block deploys. Migrations lock rows. APIs fail because they don’t know what to do with the new field. The right approach keeps performance stable and delivers the feature fast.
First, define the new column with the exact type it needs. Be explicit. Avoid generic types that invite later migrations. Use defaults sparingly—only when they make sense for existing records.
Second, create the column in a way that avoids downtime. In PostgreSQL, adding a nullable column without a default is instant. If you must add a default, set it in a later step with UPDATE in small batches to prevent table locks.
Third, update your code to handle the new column gracefully. Default to nil or empty values until backfill completes. Deploy changes that can run safely with both the old and new schema. This keeps rolling deploys smooth.