Adding a new column should be simple. In production, it is not. Schema changes create risk. They can lock tables, trigger downtime, or break code paths that assume older structures. A single mistake propagates across services and environments.
Start with a migration plan. Define the new column and its data type. Choose a safe default or allow nulls to prevent writes from failing. Avoid non-null without a default on large tables; it will force a full-table rewrite.
Run migrations in small, reversible steps. First add the column without constraints. Next, backfill data in batches to reduce load. When complete, add constraints or indexes to enforce integrity. Each step should be idempotent and safe to retry.
Test the migration on a replica or staging environment with production-scale data. Verify query performance after the new column exists. If the column supports high-traffic queries, consider adding it behind a feature flag or toggling client logic after deployment.