The change sounded simple: add a new column.
A new column in a database is not just a line in a migration script. It changes the schema, alters storage patterns, and can impact query performance. In production systems, a poorly planned new column can trigger locks, spike CPU, or block writes. Precision matters.
Start with a clear migration strategy. Map existing dependencies. Check ORM models, raw SQL queries, caching layers, and API contracts. Every reference to the old schema must align with the new column name, data type, and constraints. A breaking change here can cascade silently until your monitoring turns red.
For relational databases, choose between ADD COLUMN with a default, a nullable column, or a phased rollout. Adding a non-null column to a large table with a default can rewrite the entire table and lock it. In PostgreSQL, adding a nullable column without a default is fast and safe, followed by background backfilling. MySQL requires similar caution and tool-assisted online schema changes for large datasets.