The database stopped. The query failed. The error pointed to a missing column. You needed a new column, and you needed it before the next deploy.
Adding a new column sounds simple—until it isn’t. Schema changes can block writes, lock tables, and break production. The right approach depends on your database, your migration tooling, and your zero-downtime strategy.
First, define the purpose. Avoid vague names. Use consistent naming conventions that align with your schema. Decide the data type with precision. Integer, text, boolean—pick what the logic demands, not what seems flexible. Over-general types create long-term instability.
Second, plan the migration. In PostgreSQL, ALTER TABLE ADD COLUMN is fast for nullable fields without defaults. In MySQL, behavior depends on storage engine and version. Adding a column with a default value may rewrite the whole table. In high-traffic environments, this can cause stalls.