Adding a column should be simple. Yet in production, it can mean locked tables, downtime, or unpredictable migrations. The key is choosing the right method for your database engine and your data scale. In MySQL, use ALTER TABLE ... ADD COLUMN for small datasets; for large ones, consider pt-online-schema-change to avoid write locks. In PostgreSQL, adding a nullable column with a default value is fast, but adding a NOT NULL with default rewrites the table—plan for that.
A new column changes more than the schema. Application code must handle null values, migrations must run idempotently, and old deployments must stay compatible during gradual rollouts. Use feature flags to gate logic that depends on the new field. Always write migrations that can run twice without breaking.
Version control your schema changes. Keep SQL scripts in the same repo as application code. Test your migrations against a snapshot of production data before pushing them live. Watch query plans after the new column exists; indexes may be required to keep performance steady.