The query landed, and the schema was already wrong. You needed a new column, and you needed it without breaking production.
A new column is not just another field in a table. It changes how data flows, how indexes work, how queries perform. Whether you run PostgreSQL, MySQL, or a distributed database, adding a new column must balance speed, safety, and compatibility.
Start with the migration plan. Identify the table size, index usage, and active query patterns. For large datasets, adding a new column with a default value can lock writes or spike CPU load. Use online schema changes when your database engine supports them. In PostgreSQL, prefer ADD COLUMN without defaults, then backfill in batches. In MySQL, use tools like gh-ost or pt-online-schema-change for zero-downtime execution.