The error appeared after a single migration. The schema was correct, but the app failed. The log pointed to missing data in a new column.
Adding a new column sounds simple. In production, it can break critical paths. Databases handle structure changes differently. Some apply instantly. Others lock tables. A careless ALTER TABLE can block requests and stall the system.
The first step is to choose the right migration strategy. For small tables, a direct ALTER TABLE ADD COLUMN is often safe. For large tables, consider adding the column with a default of NULL and backfilling values in batches. Avoid adding a non-nullable column with a default value in one step on massive datasets—it can trigger a full table rewrite and cause downtime.
When adding a new column, test both the schema change and the application code in staging. Confirm that ORM mappings, serializers, and API payloads handle the field correctly. Monitor read and write latencies after release. Many outages happen when application code expects a new column to exist before migrations complete.