The codebase stared back at you with a silent warning: the schema was wrong. You needed a new column. Not tomorrow. Now.
Adding a new column in a production database is never a throwaway task. It changes the shape of your data. It touches code paths you forgot existed. It influences migrations, indexes, queries, and integrations. If done carelessly, it can lock tables, block writes, or force downtime.
Start with the schema definition. Identify the correct data type. Keep the constraints explicit—NOT NULL only when the column can always be filled. Avoid premature default values; they can make migrations costly if the dataset is large.
Plan the migration in versions. The safest approach is to create the new column nullable, deploy that change, backfill data in controlled batches, then add constraints in a second migration. This minimizes lock time and prevents blocking live requests.