The logs gave no reason—just a silent error after altering a table and trying to add a new column.
Adding a new column looks simple: ALTER TABLE table_name ADD COLUMN column_name data_type;. But in production, the details decide whether you ship clean code or spend the night rolling back. A new column can break queries, lock writes, or create performance regressions if added without strategy.
Start with a dry run in staging using the same schema and dataset size as production. Measure how long the new column creation takes, how it affects existing indexes, and what happens to related triggers or constraints. Use an explicit column definition with NOT NULL only if you can backfill instantly; otherwise, keep it nullable and run a background job to fill data.
If using PostgreSQL, be aware that adding a NOT NULL column with a default value before version 11 rewrites the entire table. MySQL has its own pitfalls, such as full table rebuilds when altering large tables. In high-traffic environments, consider online schema change tools like gh-ost or pt-online-schema-change.