The database migration had gone live, but the numbers didn’t line up. The fix was simple: add a new column.
A new column changes how your application stores and retrieves data. It can reshape queries, enable new features, and unlock faster analytics. But done wrong, it can block deployments, lock tables, or trigger downtime in production.
Start by defining the new column with the correct data type. Pick types that match future use as well as current needs. Mismatched data types are a top source of migration failures. If the column needs an index, plan it upfront. Adding indexes later can rewrite the whole table on large datasets.
Use non-blocking migrations when possible. In PostgreSQL, ALTER TABLE ADD COLUMN is fast if the column has no default. Defaults on large tables often rewrite data, impacting availability. In MySQL, check if your engine supports instant column addition; if not, break changes into steps.