A new column changes more than the table. It touches schema migrations, application code, indexes, and data integrity. If you run in production, the wrong migration can lock tables or trigger downtime. Plan it like a deployment, not a quick patch.
Start with a safe schema migration. Use ALTER TABLE with care. On large datasets, consider online schema change tools like pt-online-schema-change or gh-ost to avoid blocking writes. In cloud databases, check if your provider supports instant or metadata-only column adds.
Define the column with the correct type and constraints from the start. Avoid NULL defaults if you truly require a value. Ensure column naming stays consistent with your existing conventions. A bad name lingers for years.
Update application code in a separate step. First deploy code that can handle both old and new schemas. Then run the migration. Only after confirming the column exists and is populated should you remove legacy paths. This staged rollout prevents runtime errors.