Adding a new column to a database table sounds routine. It is not. Every change in schema carries risk: downtime, data loss, broken queries. The wrong approach can stall the release pipeline or corrupt production records. The right approach makes the change clean, fast, and safe.
First, decide if the new column is nullable or has a default value. This choice determines how the migration runs in production. A NOT NULL column without a default will fail if existing rows are missing data. In high-traffic environments, this can block writes and cause outages.
Second, use online schema changes where supported. Tools like pt-online-schema-change or native ALTER algorithms in MySQL and Postgres reduce locking and keep the system responsive. Always test the migration on a staging environment with production-size data to measure execution time and load impact.