Adding a new column to a production database is not just an ALTER TABLE command. It is a change that can block writes, lock rows, or cascade failures through dependent services. Doing it well means planning for zero downtime, preserving data integrity, and making the schema change safe for both current and future application code.
Start by checking the table size. On millions of rows, adding a new column with a default value can rewrite the entire table. This can lock queries and degrade performance for hours. Split the operation: first add the column as nullable, then backfill in small batches, then set constraints or defaults if needed.
Review the ORM migrations. Many tools generate a single monolithic migration, which can be dangerous in production. Break it into discrete steps and deploy them separately. Always test on a staging environment with a copy of production data to estimate execution time.