Adding a new column is one of the most common schema updates. It looks simple, but the wrong approach can lock tables, block queries, and slow service. The right approach makes it invisible to users and safe for production.
First, define the new column with precise data types. Every data type choice affects storage, indexing, and query performance. Avoid defaults that hide future problems, like a text field when a constrained enum fits better. Decide if the column should allow NULL values now or enforce NOT NULL from the start.
Second, plan the migration. In most databases, an ALTER TABLE command will modify the existing schema, but its effect can vary. In PostgreSQL, adding a nullable column without a default is fast. Adding a column with a default value can trigger a full table rewrite. In MySQL, the impact depends on storage engine and column order. Use tools like pt-online-schema-change or built‑in online DDL features to avoid downtime.