Adding a new column in a production database is simple to type but risky to execute. Schema changes can lock tables, slow queries, or block writes. The wrong migration can stall the system. The right migration feels invisible.
First, decide if the new column is nullable. A non-null column with no default will fail on existing rows. If the column must be non-null, add it as nullable first, backfill values in batches, then add the constraint. This avoids full table locks and downtime.
Choose the correct data type from the start. Changing column types later can be more expensive than the initial add. Use timestamps instead of generic strings for date data. Avoid over-sizing string columns without reason.
Run the migration in a controlled environment before you run it in production. Check query plans. Measure the effect with production-like data volume. If the table is large, use online schema change tools like pt-online-schema-change for MySQL or ALTER TABLE ... ADD COLUMN with concurrent options in PostgreSQL where supported.